Hi,
I have input like:
sno,sname
1,ravi
1,suresh
2,mahesh
3,hari
but I want output like:
sno,sname
1,hari
1,mahesh
2,suresh
3,ravi
my source and target both are text files.I want to reverse second column (sname)
please any one help me?
How to reverse data order?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
This does seem to be a strange requirement, but it can be done.
Add an artificial key such as line number. Use a Copy stage to split the stream into two, with one column in each stream. Sort sname in reverse order and generate a new line number for this stream. Use a Join stage to inner join the two streams.
Add an artificial key such as line number. Use a Copy stage to split the stream into two, with one column in each stream. Sort sname in reverse order and generate a new line number for this stream. Use a Join stage to inner join the two streams.
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.