row to column
Posted: Mon May 14, 2007 12:49 am
Input
====
col1 col2 col3
A,B,C,D,E,F,G a,b,c,d,e,f,g P,Q,R,S,T,U,V
Output
====
col1 col2 col3
A a P
B b Q
C c R
D d S
E e T
F f U
G g V
I have implemented this
I have taken input data into a Transformer, where using
Ereplace(DSLink2.inputColumn, ",", CHAR(13):CHAR(10)),
i have converted each input column into as many rows as no. of alphabet in the input column and created 3 output stream for each input column and passed each to different sequential file.
Then next step passing each of these stream to another transformer, where i am generating a dummy id for each stream.
Next two of these streams are passed to two different hash files and one stream to a transformer, where i am joining 3 stream again using id to get output.
For this i have 5 transformers, 2 hash files and 5 sequential files.
seq file1--->Transformer1---->seq file2--->Transformer2----hash file1-----|
|
|----------->seq file3---->Transfomer3----hash file2-- |
| |
------------>seq file4----->Transfomer4------------->Transformer5------>seq file5
Please let me know if is there any better way to acheive the same result?
Thanks in advance
====
col1 col2 col3
A,B,C,D,E,F,G a,b,c,d,e,f,g P,Q,R,S,T,U,V
Output
====
col1 col2 col3
A a P
B b Q
C c R
D d S
E e T
F f U
G g V
I have implemented this
I have taken input data into a Transformer, where using
Ereplace(DSLink2.inputColumn, ",", CHAR(13):CHAR(10)),
i have converted each input column into as many rows as no. of alphabet in the input column and created 3 output stream for each input column and passed each to different sequential file.
Then next step passing each of these stream to another transformer, where i am generating a dummy id for each stream.
Next two of these streams are passed to two different hash files and one stream to a transformer, where i am joining 3 stream again using id to get output.
For this i have 5 transformers, 2 hash files and 5 sequential files.
seq file1--->Transformer1---->seq file2--->Transformer2----hash file1-----|
|
|----------->seq file3---->Transfomer3----hash file2-- |
| |
------------>seq file4----->Transfomer4------------->Transformer5------>seq file5
Please let me know if is there any better way to acheive the same result?
Thanks in advance