Hi,
I need to create output files for distinct values in col1 and put corresponding data into those files.
input file:
col1,col2
1,xx
1,yy
2,zz
So,i read the posts and implemented the logic by using the awk command
awk '{nPosField1=index($0,",");print substr($0,nPosField1+1)>substr($0,1,nPosField1-1)}' in external target stage
by giving input as file name in column1 and data in column2 from a transformer.
This worked fine when my record delimeter is end or newline.
I need my record delimeter to be \x00 and final delimeter to be none.
so that my Output will be
out_1.txt->1,xx^@1,yy^@
out_2.txt->2,zz^@
In this case the above command will not hold good as the records are not in new line.Please suggest me how to achieve this?
Create output files dynamically
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 597
- Joined: Fri Apr 29, 2005 6:19 am
- Location: Singapore
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Server jobs have a Folder stage that does this. You could use one of those in a server Shared Container in a parallel job, or maybe do all of your processing in a server job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.