HI
I had a requirement
my source file(.csv format) is like
c1 c2 c3
a 1 22
b 1 22 21
c 2 12 21 22
d 4 12 21 22 33
I need output like
c1 c2 c3
a 1 22
b 1 22
b 1 21
c 2 12
c 2 21
c 2 22
d 4 12
d 4 21
d 4 22
d 4 33
like this
Thanks you for your help in advance
Breaking a single column to multiple columns
Moderators: chulett, rschirm, roy
Transformer, Stage Variables and Partitioning with sorting are your best friend in this case.
Put some logic, you can treat the whole as a single column or segment them to different columns (but that's dependent on the type of separator you have ,for instance it could be space).
In the transformer use the variables and store in them after partition and sorting. Do the same for output (sorting), and use remove duplicates stage if needed afterward.
Cheers
Put some logic, you can treat the whole as a single column or segment them to different columns (but that's dependent on the type of separator you have ,for instance it could be space).
In the transformer use the variables and store in them after partition and sorting. Do the same for output (sorting), and use remove duplicates stage if needed afterward.
Cheers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Breaking a single column to multiple columns
hi all
but there is no limit for the count of values in cl3.It can be any 'n' numbers separated by " "(space).
Thanks
but there is no limit for the count of values in cl3.It can be any 'n' numbers separated by " "(space).
Thanks
rAKESH
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
None of that information was in your original question, which advised comma delimited. However, you can re-parse your data into as many columns as required - it's still a pivot that you want to do.
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.