The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #9 (permalink)  
Old 11-02-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 1,009
awk would be useful for pulling out that information. Try this:

Code:
awk -F' *, *' '
    # Print a line feed if we hit a new record and it is not the first one
    /^Statistics/ && NR>1 { print "" }
    # Print the timestamp, with no line feed after it
    /^Statistics/ { printf $6 }
    # Print a comma followed by the throughput, with no line feed
    /^ThroughPut/ { printf ","$3 }
    # Print a line feed at the end of the data
    END { print "" }
' inputfile > outputfile