1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
<?xml version="1.0" encoding="UTF-8"?>
<helpdocument version="1.0">
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<meta>
<topic id="textscalcguidecsv_filesxml" indexer="include">
<title xml-lang="en-US" id="tit"> Importing and Exporting CSV Files </title>
<filename>/text/scalc/guide/csv_files.xhp</filename>
</topic>
</meta>
<body>
<bookmark xml-lang="en-US" branch="index" id="bm_id892361"><bookmark_value>number series import</bookmark_value>
<bookmark_value>data series import</bookmark_value>
<bookmark_value>exporting; tables as text</bookmark_value>
<bookmark_value>importing; tables as text</bookmark_value>
<bookmark_value>delimited values and files</bookmark_value>
<bookmark_value>comma separated files and values</bookmark_value>
<bookmark_value>text file import and export</bookmark_value>
<bookmark_value>csv files;importing and exporting</bookmark_value>
<bookmark_value>tables; importing/exporting as text</bookmark_value>
<bookmark_value>text documents; importing to spreadsheets</bookmark_value>
<bookmark_value>opening;text csv files</bookmark_value>
<bookmark_value>saving;as text csv</bookmark_value>
</bookmark><comment>MW deleted "importing;text data bases" and copied 4 index entries from scalc/guide/csv_formula.xhp</comment><comment>mw added "saving;" and "opening;"</comment>
<h1 id="par_idN10862"><variable id="csv_files"><link href="text/scalc/guide/csv_files.xhp">Opening and Saving Text CSV Files</link>
</variable></h1>
<paragraph xml-lang="en-US" id="par_idN10880" role="paragraph">Comma Separated Values (CSV) is a text file format that you can use to exchange data from a database or a spreadsheet between applications. Each line in a Text CSV file represents a record in the database, or a row in a spreadsheet. Each field in a database record or cell in a spreadsheet row is usually separated by a comma. However, you can use other characters to delimit a field, such as a tabulator character.</paragraph>
<paragraph xml-lang="en-US" id="par_idN10886" role="paragraph">If the field or cell contains a comma, the field or cell <emph>must</emph> be enclosed by single quotes (') or double quotes (").</paragraph>
<h2 id="par_idN10890">To Open a Text CSV File in Calc</h2>
<list type="ordered">
<listitem>
<paragraph xml-lang="en-US" id="par_idN10897" role="listitem">Choose <item type="menuitem">File - Open</item>.</paragraph>
</listitem>
<listitem>
<paragraph xml-lang="en-US" id="par_idN1089F" role="listitem">Locate the CSV file that you want to open.</paragraph>
<paragraph xml-lang="en-US" id="par_idN108A2" role="listitem">If the file has a *.csv extension, select the file.</paragraph>
<paragraph xml-lang="en-US" id="par_idN108A5" role="listitem">If the CSV file has another extension, select the file, and then select "Text CSV" in the <emph>Filter</emph> box</paragraph>
</listitem>
<listitem>
<paragraph xml-lang="en-US" id="par_idN1082D" role="listitem">Click <item type="menuitem">Open</item>.</paragraph>
<paragraph xml-lang="en-US" id="par_idN10834" role="listitem">The <item type="menuitem">Text Import</item> dialog opens.</paragraph>
</listitem>
<listitem>
<paragraph xml-lang="en-US" id="par_idN108B1" role="listitem">Specify the options to divide the text in the file into columns.</paragraph>
<paragraph xml-lang="en-US" id="par_idN108BB" role="listitem">You can preview the layout of the imported data at the bottom of the <item type="menuitem">Text Import</item> dialog. </paragraph>
<paragraph xml-lang="en-US" id="par_id8444166" role="listitem">Right-click a column in the preview to set the format or to hide the column.</paragraph>
<paragraph role="tip" id="par_idN108E2">Check the text delimiter box that matches the character used as text delimiter in the file. In case of an unlisted delimiter, type the character into the input box.</paragraph>
</listitem>
<listitem>
<paragraph xml-lang="en-US" id="par_idN108C5" role="listitem">Click <item type="menuitem">OK</item>.</paragraph>
</listitem>
</list>
<h2 id="par_idN108FA">To Save a Sheet as a Text CSV File</h2>
<note id="par_idN106FC">When you export a spreadsheet to CSV format, only the data on the current sheet is saved. All other information, including formulas and formatting, is lost.</note>
<list type="ordered">
<listitem>
<paragraph xml-lang="en-US" id="par_idN10901" role="listitem">Open the Calc sheet that you want to save as a Text CSV file.</paragraph>
<paragraph role="note" id="par_idN107AF">Only the current sheet can be exported.</paragraph>
</listitem>
<listitem>
<paragraph xml-lang="en-US" id="par_idN10905" role="listitem">Choose <item type="menuitem">File - Save as</item>.</paragraph>
</listitem>
<listitem>
<paragraph xml-lang="en-US" id="par_idN10915" role="listitem">In the <item type="menuitem">File name</item> box, enter a name for the file.</paragraph>
</listitem>
<listitem>
<paragraph xml-lang="en-US" id="par_idN1090D" role="listitem">In the <emph>Filter</emph> box, select "Text CSV".</paragraph>
</listitem>
<listitem>
<paragraph xml-lang="en-US" id="par_idN107DD" role="listitem">(Optional) Set the field options for the Text CSV file.</paragraph>
<paragraph xml-lang="en-US" id="par_idN1091C" role="listitem">Select <item type="menuitem">Edit filter settings</item>.</paragraph>
<paragraph xml-lang="en-US" id="par_idN107ED" role="listitem">In the <item type="menuitem">Export of text files</item> dialog, select the options that you want.</paragraph>
<paragraph xml-lang="en-US" id="par_idN107F4" role="listitem">Click <item type="menuitem">OK</item>.</paragraph>
</listitem>
<listitem>
<paragraph xml-lang="en-US" id="par_idN107FC" role="listitem">Click <item type="menuitem">Save</item>.</paragraph>
</listitem>
</list>
<section id="relatedtopics">
<embed href="text/scalc/guide/csv_formula.xhp#csv_formula"/>
<embed href="text/shared/guide/data_im_export.xhp#data_im_export"/>
<paragraph xml-lang="en-US" id="par_id3153487" role="paragraph"><switchinline select="sys"><caseinline select="MAC">%PRODUCTNAME - Preferences</caseinline><defaultinline>Tools - Options</defaultinline></switchinline> - <link href="text/shared/optionen/01060100.xhp" name="Spreadsheet - View">%PRODUCTNAME Calc - View</link></paragraph>
<paragraph xml-lang="en-US" id="par_id3153008" role="paragraph"><link href="text/shared/00/00000207.xhp" name="Export text files">Export text files</link></paragraph>
<paragraph xml-lang="en-US" id="par_id3155595" role="paragraph"><link href="text/shared/00/00000208.xhp" name="Import text files">Import text files</link></paragraph>
</section>
</body>
</helpdocument>
|