The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 08-15-2007
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,409
This uses the sequence numbers to remove line breaks...
Code:
awk -F, 'NR==1{c=$1+1}$1!=c{printf "%s ",$0}$1==c{c++;printf "\n%s",$0}END{printf ORS}' file1 > file2