CategoryHowTo
Tab-Delimited Import
Magic does not allow the input of the <Tab> character as a delimiter. If your data is not in fixed-size columns or if commas are included in the data itself, you may need to resort to a tab-delimited import file. Using the following method, you can construct a tab-delimited import program in just a few minutes.
Index
Construct database file
Generate an Import program
Modify the Program
Export/Import the Program
Please edit this page...
Database File
Construct your table in Magic. Use field pictures and storage types as you like. Magic will convert the text to the database types you specify. Be sure to include an index.
Generate Program
When you have the table constructed to suit, highlight it in the Table Repository and press <Ctl+G> to generate a program.
Mode - Generate
Option - Import
Columns - If you want all columns and their sequence matches the import file, leave this parameter as it is. If your table contains more fields or a different sequence of fields, Zoom here and change the sequence of the Column or set missing fields to 0 to remove them from the import program.
Program name - As you like it.
Text file - Leave it as is for now.
Click <OK> to generate the program.
Modify Program
Change to your Program Repository. At the bottom, you will find your newly generated program.
Go to the Record Suffix and select the Input Form operation. Change the Dlm: value from "Column" to "Single".
Go to the I/O Repository <Ctl+I> and zoom on the Exp/Var column. Replace the expression with the fully-qualified path to your import file.
Export/Import the Program
Export your program to the desktop, then open it in your text editor and search for the string "DLMR"
You will find the phrase "DLMR=32" The 32 refers to the <blank> character because we did not specify a delimiter in our program.
Change the 32 to 9, which is the decimal value of a <Tab> character.
Save your changes, open your application and import the program you just modified.
CategoryHowTo
There are no comments on this page. [Add comment]