split data row

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
belaruska
Premium Member
Premium Member
Posts: 12
Joined: Wed Feb 28, 2007 5:00 pm

split data row

Post by belaruska »

I have a file with variable length rows

i.e.:

val1:data1;val2:data2;val3:data3
val4:data4
val5:data5;val6:data6

i need to split values and data, such that all values are in one string and all data in the other

Please advise on the ways to do it
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Pre-process the file (with tr perhaps) to convert all the ";" characters to line terminators - that way you will have one value:data pair per line. If you use tr as the filter command on a Sequential File stage, the stage will read stdout from the tr command as the source.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply