Remove Header

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
kumar66
Participant
Posts: 265
Joined: Thu Jul 26, 2007 12:14 am

Remove Header

Post by kumar66 »

Hi All,

Is there any way to remove the header from the file . Where I am using file type as file pattern.

Bascially I am reading multiple files.

Please hel me on this.

Thanks & Regards,
Kumar66
nagarjuna
Premium Member
Premium Member
Posts: 533
Joined: Fri Jun 27, 2008 9:11 pm
Location: Chicago

Post by nagarjuna »

Since you are using file pattern option , i think filter option wont be available in seq file stage .So , we can remove the headers with the help of transformer constraints
Nag
nirdesh2
Participant
Posts: 56
Joined: Thu Nov 20, 2008 12:18 pm
Location: Noida

Post by nirdesh2 »

You can use filter stage after reading the data from multiple files to drop the rows which is the header of the file.
Nirdesh Kumar
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Under "options" in the sequential file stage you can specify "First line is Column Names" which effectively skips the first line.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not with a file pattern and multiple files, unfortunately. :cry:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Craig - I just had to run to a designer client and try that out, but now I know that you are correct.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yah, would be cool if it worked and would certainly simplify things.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Maybe you can filter them out in a stage or do 'grep -v' for something special in header.
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

Just had a look for myself, I still have the "First Line is Column Names" option when selecting File Pattern, haven't run it but why can't it be used?

Or stream in as single column and do a DCount - assuming header record has different number of columns as other rows - then send through a column import.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Oh, you can certainly use it, it's just that it won't work on anything other than the first file from what I recall. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

Ahhh, I see... so pretty pointless then... :)
Post Reply