I have encountered some problems with Fast Export.
Using a training script to train users on Fast Export and Fast Load, we run an export and then run the load.
When we recently ran the export, the file that was output was a flat-file format, where the first column had 11 characters and the second column 6. This basically means that each column in each row is right-justified and padded with enough spaces to bring it up to the column length.
Before, when I ran FastExport it output a tab-delimited file. I could then use this file to demonstrate FastLoad. Now, I would need to open the file up in Excel, and then save it as a tab-delimited, this left-justifies the text and puts the needed tab in.
My question is how can I specify what delimiter FastExport is using?
Here is the script:
.begin export sessions 4;
.export outfile x:\export.txt
Mode record format text;
Select prdid (char (11)) ,prdcd (char (6))
As I mentioned, the workaround was to open the output file in Excel, save it as a tab-delimited file and then try the fastload again, and it worked.
I am ok on Fastload, as you can directly set the delimiter you will use, or use the DEFINE to set that up. I just can't understand why FastExport is saving as a flat-file.
Select Trim(Prdid) ||',' ||Trim(Prdcd) (Char(40)) From .... ;
That produces a 40 character line with the comma delimited Prdid and Prdcd and spaces at the end. (BTEQ truncates trailing spaces, Fastexport does not.) We then use a simple sed command to remove the trailing spaces and it is then ready for fastload.
Sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline). While in some ways similar to an editor which permits scripted edits (such as ed), sed works by making only one pass over the input(s), and is consequently more efficient. But it is sed's ability to filter text in a pipeline which particularly distinguishes it from other types of editors.