Page 1 of 1

split

Posted: Sun Dec 13, 2009 10:57 pm
by new_ds_man
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.

Posted: Sun Dec 13, 2009 11:49 pm
by ray.wurlod
For a finite domain use a Transformer, Switch or Filter stage to effect the split.

Re: split

Posted: Mon Dec 14, 2009 5:45 am
by puliram
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

Posted: Mon Dec 14, 2009 2:29 pm
by Kryt0n
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...