Unix/Linux Go Back    



Columns to Rows

Windows & DOS: Issues & Discussions




Kindly Note - This is a Single User Post by Forum Member guruprasadpr Regarding:
Columns to Rows.
Please Follow The Primary Link Above to View the Full Discussion.

   
Old Unix and Linux 07-13-2012   -   Original Discussion by sameeribraimo
guruprasadpr's Unix or Linux Image
guruprasadpr guruprasadpr is offline Forum Advisor  
Shrink...ing
 
Join Date: Jun 2009
Last Activity: 13 September 2017, 5:57 AM EDT
Location: India
Posts: 676
Thanks: 30
Thanked 215 Times in 214 Posts
Hi




Code:
$ gawk '$1==x{y=y FS $2;next}{if(y)print y;x=$1;y=$1 FS $2;}END{print y;}' file
A 1 2 3
B 1 2 3
C 1 2
D 1 2 3 4