On Mon, May 23, 2005 at 04:17:44PM -0500, Colin Ingram wrote:
(...)
this creates a file that looks like this:
00:00.000, 3.24557e+007
00:02.510, 3.23482e+007
00:05.007, 3.24578e+007
00:07.507, 2.77091e+007
---snip---
I now need to covert the "elapse time" column from the string format
"hours:min:sec" to a column containing just seconds. I am unsure how to
do this. Can I use command substitution in a sed substitute command?
You could pipe the output of your script through the following perl
command:
... | perl -pe 's/^(\d+):(\d+):(\d+)/$1*60**2 + $2*60 + $3/e'
in case the time string represents "hours:min:sec".
If it's "min:sec.msec" (looks like it to me...), then it'd be