How to: Replicate to and from Text Files

DD 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>

Put <data folder> path into the Db. Path & Name field in the Distribution Location Card, where data files will be exported to or imported from. Select Version with Text mode, <ext> is the 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"

Tip: When you are importing from a Text file to LS Central, you can see how the Text file should be formatted and if everything works as it should by starting the export of data from Central to Text. You can then swap locations in the Scheduler Job to do the import.