Transposing only part of row into column
I am trying to transpose the following row:
x1 x2 x3 x4 into x1 X2 x3 x4 With tr ' ' '\n' < file I can select all columns to become separate rows, but as you see x3 and x4 have to be grouped when transposing....Or should I use awk for this one? Couldn't find solutions in the former transpose questions, so suggestions would be very welcome. |
Hi,
Is the capital X (x2 vs X2) a typo? If it is: Code:
awk '{ print $1, $2 "\n" $3, $4 }' infile Code:
awk '{ print $1, toupper($2) "\n" $3, $4 }' infile |
All times are GMT -5. The time now is 02:39 AM. |