server routine for eliminating headers
Posted: Fri Nov 02, 2007 6:38 am
Hello everyone,
I am writing an application that should read data from csv files for further processing. The problem is that these csv files may or may not contain a header record, depending on the source.
I know how to eliminate the header (if present) using UNIX (sed, for example does it quite elegantly). But I would like to do it using a DataStage server routine. The routine needs to check the existence of a certain string (e.g. "Country_Code") whose presence would indicate that its a header record, and then delete that record from the input file, and leave the file untouched if the string doesn't exist in it.
Any help much appreciated!
Thanks,
kaus
I am writing an application that should read data from csv files for further processing. The problem is that these csv files may or may not contain a header record, depending on the source.
I know how to eliminate the header (if present) using UNIX (sed, for example does it quite elegantly). But I would like to do it using a DataStage server routine. The routine needs to check the existence of a certain string (e.g. "Country_Code") whose presence would indicate that its a header record, and then delete that record from the input file, and leave the file untouched if the string doesn't exist in it.
Any help much appreciated!
Thanks,
kaus