The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



Thread: changing format
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 01-30-2008
jaduks's Avatar
jaduks jaduks is offline
Registered User
 

Join Date: Aug 2007
Location: Assam,India
Posts: 155
Code:
$ awk -F "," '{print NR-1,$0}' shary | tr ',' ' '
And if you have fixed length of fields,

Code:
$ awk -F "," 'BEGIN{OFS=" "}{print NR-1,$1,$2,$3,$4}' shary
//Jadu
Reply With Quote