You register a database only once. A database can be any SQL database connectable via ODBC or JDBC. Apart from true databases, LibreOffice supports dBase files, text files, spreadsheets or even text tables in Writer documents.
[Some kind of database] —> [Base document] —> [Office Document]
In your particular case you may link a directory of similar tab-separated text files to a Base document. This way each text files appears in the Base document as a table of some pseudo-database.
menu:File>New>Database… type:Text, specify directory, separators, encoding. The resulting database document will NOT contain any data. It only stores the connection settings.
Optionally, you may add simple queries to modify the sort order, column order, column labels of one table or apply some filter(s).
The database is registered under some short name, by default it is the name of the database document without .odb suffix.
In Writer hit Ctrl+Shift+F4 for the data source window.
In the left pane you see your registered database with tables and queries.
RIght-click>“Edit database” opens the selected database document.
Right-click>“Registered databases” shows a list with all registered databases (also via Tools>Options… Base>Databases).
- You have a registered database in the data source window connected to whatever.
- You have a form letter.
When you select a table or query in the left pane, the record set appears in the right pane from where you can drag&drop column labels into your Writer document as mail merge fields.
Later, when you need to use another text file, put it in the same directory as the other text files. In Writer call menu:Edit>Exchange Database… and point to the new table. This will modify the mail merge fields accordingly.
If your mail merge fields are linked to a query, open the database document, edit the query and change the table name, so the query does the same thing with another table.