The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



Thread: UNIX awk help
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 09-27-2007
Ygor's Avatar
Ygor Ygor is offline
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,221
Try...
Code:
awk -F, '{for(i=1;i<NF;i++) printf $i (i>13&&i%3==2?";":",");print $NF}' file1
Tested...
MEPMD01,19970819,Sensus,SDGE,SDGE,,200705221435,1888961,OK,E,KWH,1,00000015,48;200705210715,R 00 40,2.0000;200705210730,R 00 40,1.0000;200705210745,R 00 40,2.0000;200705210800,R 00 40,1.0000;200705210815,R 00 40,2.0000;200705210830,R 00 40,2.0000;200705210845,R 00 40,1.0000;200705210900,R 00 40,2.0000;200705210915,R 00 40,2.0000;200705210930,R 00 40,1.0000;200705210945,R 00 40,2.0000;200705211000,R 00 40,1.0000;200705211015,R 00 40,2.0000;200705211030,R 00 40,2.0000;200705211045,R 00 40,1.0000;200705211100,R 00 40,2.0000;200705211115,R 00 40,2.0000;200705211130,R 00 40,1.0000;200705211145,R 00 40,2.0000;200705211200,R 00 40,1.0000;200705211215,R 00 40,2.0000;200705211230,R 00 40,2.0000;200705211245,R 00 40,1.0000;200705211300,R 00 40,2.0000;200705211315,R 00 40,2.0000;200705211330,R 00 40,1.0000;200705211345,R 00 40,2.0000;200705211400,R 00 40,1.0000;200705211415,R 00 40,1.0000;200705211430,R 00 40,2.0000;200705211445,R 00 40,1.0000;200705211500,R 00 40,1.0000;200705211515,R 00 40,1.0000;200705211530,R 00 40,1.0000;200705211545,R 00 40,1.0000;200705211600,R 00 40,1.0000;200705211615,R 00 40,1.0000;200705211630,R 00 40,1.0000;200705211645,R 00 40,1.0000;200705211700,R 00 40,1.0000;200705211715,R 00 40,1.0000;200705211730,R 00 40,1.0000;200705211745,R 00 40,1.0000;200705211800,R 00 40,1.0000;200705211815,R 00 40,1.0000;200705211830,R 00 40,1.0000;200705211845,R 00 40,1.0000;200705211900,R 00 40,1.0000
Reply With Quote