Page 1 of 1

Reading Multiple Flat Files with Headers using File Pattern

Posted: Wed May 16, 2012 2:29 am
by jerome_rajan
Hi,

I am posed with an elementary level issue. The requirement is to read multiple files with similar schemas and load into a table. The problem is that each of these files have column names as header.

When I try reading all the files of a specific pattern using the 'FILE PATTERN' property in the Sequential File stage, all but the header of the first file appear as part of the data. The data looks something like

a,b,c,d,e
c,v,b,n,n
COL1,COL2,COL3,COL4,COL5
a,d,g,h,s
COL1,COL2,COL3,COL4,COL5
a,c,v,b,n
q,e,w,q,s

The 'First Name iS Column Name' property has been set to true. I want the data to be read without the column names

Posted: Wed May 16, 2012 3:12 am
by vamsi.4a6
1)Place all the input files in the file
2)Read each input file and remove the headers through grep command from each input file and redirect the output to single output file.
3)No need to use File pattern and use the output file mentioned in step2 in sequential file stage

Posted: Wed May 16, 2012 3:13 am
by vamsi.4a6
1)Place all the input files in the file
2)Read each input file and remove the headers through grep command from each input file and redirect the output to single output file.
3)No need to use File pattern and use the output file mentioned in step2 in sequential file stage

Posted: Wed May 16, 2012 3:15 am
by jerome_rajan
The number of files will vary everyday. We are performing validations on a per-file basis based on the suffix of the file.

Re: Reading Multiple Flat Files with Headers using File Patt

Posted: Wed May 16, 2012 3:35 am
by TPons
The same kind of topic has already been discussed.
Please check whether the solution can help you to resolve your problem.

[url]viewtopic.php?t=125243&highlight=removing+header[/url]

--------
Pons

Posted: Wed May 16, 2012 6:43 am
by jerome_rajan
Thank you. Alternatives provided at viewtopic.php?t=125243&highlight=removing+header were useful