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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #9 (permalink)  
Old 05-16-2008
ripat ripat is offline
Registered User
 

Join Date: Oct 2006
Location: Belgium
Posts: 171
Without gensub:

Code:
#!/usr/bin/awk -f
BEGIN {FS=","; OFS=","}
{
                one = substr($1, match($1, /subject=BMRA.BM./) + 17, 10)
                sub(/\..+/, "", one)
                print substr($2, match($2, /[0-9][0-9][0-9][0-9]:[0-9][0-9]:[0-9][0-9]/), 10),
                one, 
                substr($5, match($5, /TS=/) + 3, 19),
                substr($3, match($3, /SP=/) + 3),
                substr($6, match($6, /VP=/) + 3)
}
Reply With Quote