Page 1 of 1

How to reverse data order?

Posted: Sun Nov 17, 2013 11:49 pm
by pkll
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?

Posted: Mon Nov 18, 2013 12:24 am
by ray.wurlod
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.