Selecting only specific columns from a file in unix

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

ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You CAN omit fields as you read. Use the Drop on Input property in the extended column definition.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well... that's a little misleading. They are still read, they're just not propagated downstream. Dropping them after input is not the same as not reading them at all, which is how I interpreted the OP's quest. Besides, you still have to fully specify them in the input data, something else the OP is trying to avoid.
-craig

"You can never have too many knives" -- Logan Nine Fingers
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Post by laknar »

Read all the columns from file and then map only the columns that you want in transformer stage.
rajesh450
Participant
Posts: 3
Joined: Wed Dec 12, 2007 2:31 am

Post by rajesh450 »

you can use below unix command in sequential file stage

cut -d"," f1,f2 <filename>
where f1&f2 are filed names
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

Hi,

'cut' command is a useful awk command to do this selective stuff

regards
Sreeni
Post Reply