How to: Replicate to and from Text Files
Data Director can import and export data from text files. Default is that column separator is the Tab character and file extension is .txt, but both can be changed.
Database connection string format: Database=<data folder>;|file|<ext>@<sepchar>
Where <data folder> is the location where the data files will be exported to or imported from, <ext> is file extension, and <sepchar> is the separation character to separate data columns in the Data File.
Each file should be named by Table name with <ext> extension.
To change the separator and file extension, change the plugin parameter string for the Connection string.
Connection string | File Ext | Separator |
---|---|---|
Database=<folder>;|file|none | .txt | Tab (char 9) |
Database=<folder>;|file|tsf | .tsf | Tab (char 9) |
Database=<folder>;|file|csv@; | .csv | Semicolon ; |
Format of the data in the file should always have the first line starting with Table, Field, Column names, then data comes in line 2. Text data can be surrounded by “ “, but that is not necessary.
Example 1
Connection string: Database=c:\DBFiles;|file|none
Data file name: Customer.txt
No. Name Search Name Name 2 Address
"011" "Spotsmeyer" "SPOTSMEYER" "612 South Sunset Drive"
Example 2
Connection string: Database=c:\DBFiles;|file|csv@;
Data file name: Customer.csv
No.;Name;Search Name;Name 2;Address
"011";"Spotsmeyer";"SPOTSMEYER";;"612 South Sunset Drive"