Reading Multiple Flat Files with Headers using File Pattern

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Reading Multiple Flat Files with Headers using File Pattern

Post 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
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post 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
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post 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
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post 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.
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
TPons
Participant
Posts: 18
Joined: Mon Jan 03, 2011 3:32 am
Location: India

Re: Reading Multiple Flat Files with Headers using File Patt

Post 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
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post by jerome_rajan »

Thank you. Alternatives provided at viewtopic.php?t=125243&highlight=removing+header were useful
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
Post Reply