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 -->
  #3 (permalink)  
Old 05-26-2008
danmero danmero is offline Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,447
Quote:
Originally Posted by ogoy View Post
If anyone can provide code that would do the math showing how many second(s) intervals per BEGIN and END.

Code:
awk '$NF=="BEGIN"{a=substr($0,10,10)}$NF=="END"{print substr($0,10,10)-a}' data.file


Last edited by danmero; 05-26-2008 at 10:41 PM.. Reason: get shorther