Advanced Database – Link external data to a database: text

For this tutorial, we are going to create a text file in LibreOffice Writer.

Open LibreOffice Writer.

11 Link external data to a database text

Enter the text shown. The first line designates field names, separated by commas. Each new line represents a new record with fields in the same order as the top line.

12 Save As TXT

Select Save As from the File menu.

Name the file and set Save as Type: to ‘Text (.txt)(*.txt)’

Exit writer and open a new database in LibreOffice Base.

13 Connect Database To Text

In the wizard, select Connect to and existing database -> Text

Click Next.

14 Set Up Connection To Text File

Click Browse in the ‘Set up a connection to text files’ section.

Select the folder that contains the text file we created.

Click OK.

Click Next.

15 Save And Proceed

Select to register the database and open it for editing.

Click Finish, name the database and click Save.

16 Open For Editing

The database will automatically open for editing.

Go to the Tables section and double-click the table with the same name as the text file as we created.

Notice that the table has been populated with the text that was saved in the document.

As the database is connected to the text file, you cannot add tables directly to the database.

17 Add A Table

To add a table, create a new LibreOffice Writer file and add some data in the same format as previously.

Save the file in the same folder as the previous text file (it must be the same folder for it to work).

Exit Writer and re-open the connected database file.

18 Database Linked To Folder

As the database is linked to the folder, the text file we just created will automatically create an identical table.

We can also add or edit the records within these text files and it will automatically update the database.