Importing and Exporting Data in Base

From LibreOffice Help
Jump to: navigation, search

An easy method to import and export database tables uses Calc as a "helper application".

Exporting data from Base

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.

  1. 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.
  2. Choose File - New - Spreadsheet.
  3. In the Base window, right-click the name of the table to export. Choose Copy from the context menu.
  4. Click cell A1 in the new Calc window, then choose Edit - Paste.

Now you can save or export the data to many file types.

Importing data to Base

Note.png You can import text files, spreadsheet files, and your system address book in read-only mode only.
Note.png 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.
Note.png 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.
  1. Open a Base file of the database type that you want.
    Either create a new Base file using the Database Wizard, or open any existing Base file that is not read-only.
  2. 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.
  3. Select the data to be copied to Base.
    You can enter a range reference like A1:X500 in the Name Box if you don't want to scroll.
    If you copy a dBASE sheet, include the top row that contains the header data.
  4. Chọn lệnh Sửa > Cắt.
  5. In the Base window, click Tables to view the tables.
  6. In the Base window, choose Edit - Paste.
  7. You see the Copy Table dialog. Most databases need a primary key, so you may want to check the Create primary key box.
Tip.png 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.

Related Topics

Sử dụng Cơ sở Dữ liệu trong LibreOffice Base

Database Overview

Nhập và Xuất các tập tin dBASE

Mở và lưu các tập tin CSV