I am attempting to calculate the run time for each job in a log file (mutiple jobs are written to one log file), however I am unsure of how to go about doing such. Below is an example of some lines from the log file:
Job Begin Date Begin T End Date End T Status
job1 01/02/2003 00:30 01/02/2003 00:30 Successful
job2 01/02/2003 00:35 01/02/2003 00:40 Successful
I would assume something like the awk command below would work, however it does not, most likely due to the fact that they are not ordinary numbers.
nawk '$1 ~ /string/ {run_time= $5 - $3; print run_time}' filename
Any help would be greatly appreciated.
Thanks,
John
Job Begin Date Begin T End Date End T Status
job1 01/02/2003 00:30 01/02/2003 00:30 Successful
job2 01/02/2003 00:35 01/02/2003 00:40 Successful
I would assume something like the awk command below would work, however it does not, most likely due to the fact that they are not ordinary numbers.
nawk '$1 ~ /string/ {run_time= $5 - $3; print run_time}' filename
Any help would be greatly appreciated.
Thanks,
John