End of CSV File / Fastload


End of CSV File / Fastload

I wrote a fastload sript which works fine to load my CSV files. It looks like following:

sessions 2;
errlimit 25;
logon xxxx/yyyy,zzzz;

DROP TABLE scsDataImport;
CREATE TABLE scsDataImport(

set record VARTEXT " ";
file = testEndSequence.CSV;
begin loading scsDataImport errorfiles error_1, error_2;
insert into scsDataImport(
end loading;

Just there is something I don't like. At the end of each CSV file, I have two empty lines. That means that the loading "crashes" and displays the message "not enough fields in in vartext data record nummer: n". If I remove the empty lines, that means if I just make a newline after the last entry, everything works fine and the import is successfull.

Well I know that I can change all the CSV files manually, but that means periodically work and is not a beautifull solution for this problem. I'm sure there is a workaround, but I couldn't find it out so far. Do you guys have any suggestion?

Tags (2)
Teradata Employee

Re: End of CSV File / Fastload

That is the way FastLoad works.

The reading of the file is expecting each record in the file to adhere to the DEFINE list of columns.

There is no workaround in FastLoad.

-- SteveF
Teradata Employee

Re: End of CSV File / Fastload

If you know there is empty lines in your data file, then pre-process the file before giving to Fastload.