1<?xml version="1.0" encoding="UTF-8"?> 2 3<!--*********************************************************** 4 * 5 * Licensed to the Apache Software Foundation (ASF) under one 6 * or more contributor license agreements. See the NOTICE file 7 * distributed with this work for additional information 8 * regarding copyright ownership. The ASF licenses this file 9 * to you under the Apache License, Version 2.0 (the 10 * "License"); you may not use this file except in compliance 11 * with the License. You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, 16 * software distributed under the License is distributed on an 17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 * KIND, either express or implied. See the License for the 19 * specific language governing permissions and limitations 20 * under the License. 21 * 22 ***********************************************************--> 23 24<helpdocument version="1.0"> 25<meta> 26<topic id="textsharedguidedata_im_exportxhp" indexer="include" status="PUBLISH"> 27<title id="tit" xml-lang="en-US">Importing and Exporting Data in Base</title> 28<filename>/text/shared/guide/data_im_export.xhp</filename> 29</topic> 30</meta> 31<body> 32<bookmark xml-lang="en-US" branch="index" id="bm_id6911546"> 33<bookmark_value>databases;importing/exporting</bookmark_value> 34<bookmark_value>importing;databases</bookmark_value> 35<bookmark_value>copying; datasource records in spreadsheets</bookmark_value> 36<bookmark_value>inserting; datasource records in spreadsheets</bookmark_value> 37<bookmark_value>spreadsheets;inserting database records</bookmark_value> 38<bookmark_value>data sources;copying records to spreadsheets</bookmark_value> 39<bookmark_value>pasting;from data sources to %PRODUCTNAME Calc</bookmark_value> 40</bookmark><comment>MW reduced "databases;" entries into one entry and deleted "exporting;from.."</comment> 41<paragraph role="heading" id="hd_id4547257" xml-lang="en-US" level="1" l10n="NEW"><variable id="data_im_export"><link href="text/shared/guide/data_im_export.xhp">Importing and Exporting Data in Base</link> 42</variable></paragraph> 43<paragraph role="paragraph" id="par_id2761314" xml-lang="en-US" l10n="NEW">An easy method to import and export database tables uses Calc as a "helper application".</paragraph> 44<paragraph role="heading" id="hd_id3912778" xml-lang="en-US" level="2" l10n="NEW">Exporting data from Base</paragraph> 45<paragraph role="paragraph" id="par_id3163853" xml-lang="en-US" l10n="NEW">You copy a table from Base to a new Calc sheet, then you can save or export the data to any file format that Calc supports.</paragraph> 46<list type="ordered"> 47<listitem> 48<paragraph role="paragraph" id="par_id121158" xml-lang="en-US" l10n="NEW">Open the database file that contains the database table to be exported. Click Tables to view the tables, or click Queries to view the queries.</paragraph> 49</listitem> 50<listitem> 51<paragraph role="paragraph" id="par_id4644306" xml-lang="en-US" l10n="NEW">Choose <emph>File - New - Spreadsheet</emph>.</paragraph> 52</listitem> 53<listitem> 54<paragraph role="paragraph" id="par_id1331217" xml-lang="en-US" l10n="NEW">In the Base window, right-click the name of the table to export. Choose <emph>Copy</emph> from the context menu.</paragraph> 55</listitem> 56<listitem> 57<paragraph role="paragraph" id="par_id3806878" xml-lang="en-US" l10n="NEW">Click cell A1 in the new Calc window, then choose <emph>Edit - Paste</emph>.</paragraph> 58</listitem> 59</list> 60<paragraph role="paragraph" id="par_id130619" xml-lang="en-US" l10n="NEW">Now you can save or export the data to many file types.</paragraph> 61<paragraph role="heading" id="hd_id9999694" xml-lang="en-US" level="2" l10n="NEW">Importing data to Base</paragraph> 62<paragraph role="note" id="par_id8494521" xml-lang="en-US" l10n="NEW">You can import text files, spreadsheet files, and your system address book in read-only mode only.</paragraph> 63<paragraph role="note" id="par_id9579760" xml-lang="en-US" l10n="NEW">When you import from a text or spreadsheet file, the file must have a first row of header information. The second row of the file is the first valid data row. The format of every field in the second row determines the format for the entire column. Any format information from a spreadsheet file gets lost when importing to Base.</paragraph> 64<paragraph role="note" id="par_id325632" xml-lang="en-US" l10n="NEW">For example, to ensure the first column has a text format, you must make sure that the first field of the first valid data row contains text. If a field in the first valid data row contains a number, the whole column is set to number format, and only numbers, no text, will be shown in that column.</paragraph> 65<list type="ordered"> 66<listitem> 67<paragraph role="paragraph" id="par_id2216559" xml-lang="en-US" l10n="NEW">Open a Base file of the database type that you want.</paragraph> 68<paragraph role="paragraph" id="par_id7869502" xml-lang="en-US" l10n="NEW">Either create a new Base file using the <link href="text/shared/explorer/database/dabawiz00.xhp">Database Wizard</link>, or open any existing Base file that is not read-only.</paragraph> 69</listitem> 70<listitem> 71<paragraph role="paragraph" id="par_id9852900" xml-lang="en-US" l10n="NEW">Open the Calc file that contains the data to be imported to Base. You can open a *.dbf dBASE file or many other file types.</paragraph> 72</listitem> 73<listitem> 74<paragraph role="paragraph" id="par_id3791924" xml-lang="en-US" l10n="NEW">Select the data to be copied to Base.</paragraph> 75<paragraph role="paragraph" id="par_id6173894" xml-lang="en-US" l10n="NEW">You can enter a range reference like A1:X500 in the Name Box if you don't want to scroll.</paragraph> 76<paragraph role="paragraph" id="par_id533768" xml-lang="en-US" l10n="NEW">If you copy a dBASE sheet, include the top row that contains the header data.</paragraph> 77</listitem> 78<listitem> 79<paragraph role="paragraph" id="par_id5669423" xml-lang="en-US" l10n="NEW">Choose <emph>Edit - Copy</emph>.</paragraph> 80</listitem> 81<listitem> 82<paragraph role="paragraph" id="par_id3619495" xml-lang="en-US" l10n="NEW">In the Base window, click <emph>Tables</emph> to view the tables.</paragraph> 83</listitem> 84<listitem> 85<paragraph role="paragraph" id="par_id1175572" xml-lang="en-US" l10n="NEW">In the Base window, choose <emph>Edit - Paste</emph>.</paragraph> 86</listitem> 87<listitem> 88<paragraph role="paragraph" id="par_id4815820" xml-lang="en-US" l10n="NEW">You see the Copy Table dialog. Most databases need a primary key, so you may want to check the <emph>Create primary key</emph> box.</paragraph> 89</listitem> 90</list> 91<paragraph role="tip" id="par_id2584002" xml-lang="en-US" l10n="NEW">On Windows systems, you can also use drag-and-drop instead of Copy and Paste. Also, for registered databases, you can open the datasource browser (press F4) instead of opening the Base window.</paragraph> 92<section id="relatedtopics"> 93<paragraph role="paragraph" id="par_id5871761" xml-lang="en-US" l10n="NEW"> 94<embedvar href="text/shared/explorer/database/main.xhp#base"/> 95</paragraph> 96<paragraph role="paragraph" id="par_id6531266" xml-lang="en-US" l10n="NEW"> 97<embedvar href="text/shared/guide/database_main.xhp#database_main"/> 98</paragraph><comment>ufi: removed switches for calc</comment><embed href="text/scalc/guide/dbase_files.xhp#dbase_files"/> 99<embed href="text/scalc/guide/csv_files.xhp#csv_files"/> 100</section> 101</body> 102</helpdocument> 103