Hi All,
I have a requirement to split the incoming data based on a key column
data comes in as:
Key column column2 column3 column4
A 1 2 3
A 4 5 6
A 19 20 21
B 7 8 9
B 10 11 12
C 13 14 15
C 16 17 18
and so on....................
I need all As,Bs,Cs in separate O/P links.
Help appreciated.
Thanks in Advance.
split
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: split
new_ds_man wrote:Hi All,
I have a requirement to split the incoming data based on a key column
data comes in as:
Key column column2 column3 column4
A 1 2 3
A 4 5 6
A 19 20 21
B 7 8 9
B 10 11 12
C 13 14 15
C 16 17 18
and so on....................
I need all As,Bs,Cs in separate O/P links.
Help appreciated.
Thanks in Advance.
------------------------------------------------------------------
Use transformer, Place two output links
in one link map colmn 1
and in other map column2, column3 and column4
Assuming you never know the key values, in a sequence job, run an awk script to get the distinct list of keys then loop through a job providing the key as input with a transformer or filter stage working off the input key.
Suitability really depends on size of file/number of distinct keys as it won't be quick.
Alternatively, a shell script to do it...
Suitability really depends on size of file/number of distinct keys as it won't be quick.
Alternatively, a shell script to do it...