Page 1 of 1

Resturcture Stages

Posted: Tue Feb 15, 2005 10:55 am
by als110
I have the following data coming in and I want it to be restructured into the second list of data. I have figured out how to do it with a transform outputted to x amount of links then funneled back together. I want to aviod this becuase in my actual job I have to do this with around 20 fields. Below is my input and what i want it translated to. Does anyone know if I can do this with a restructe stage and with which one.

Input
Key Cd1 cd2 Cd3
1 A B C
2 A B C
3 A B C


New output
KEY Code
1 A
1 B
1 C
2 A
2 B
2 C
3 A
3 B
3 C

Thank You
Aaron Smith

Posted: Tue Feb 15, 2005 11:15 am
by NewPXUser
Maybe what you need is

awk '{ for (i = 2; i<= NF; i++) { print $1 $i } }' <filename>

Re: Resturcture Stages

Posted: Tue Feb 15, 2005 12:17 pm
by rgandra
Use Pivot Stage.
Output Column Derivation
Key Key

Code Cd1, Cd2, Cd3