Hi,
I've got a file like the following:
Code:
Starting to process segment 0 (and symmetry related segments)
Number of (cancelled) singularities: 0
Number of (cancelled) negative numerators: 0
Segment 0: 5.49secs
Starting to process segment 1 (and symmetry related segments)
Number of (cancelled) singularities: 0
Number of (cancelled) negative numerators: 0
Segment 1: 10.01secs
Starting to process segment 2 (and symmetry related segments)
Number of (cancelled) singularities: 0
Number of (cancelled) negative numerators: 0
Segment 2: 7.82secs
Starting to process segment 3 (and symmetry related segments)
Number of (cancelled) singularities: 0
Number of (cancelled) negative numerators: 0
Segment 3: 5.31secs
... and I would like to extract the information about the time. I would like to read the file, save the time (of each line) to a variable, remove the suffix secs and then add it to the previous value. The result will be the total time....
I tried many things but none of them works... In case it helps, the last one I tried was
Code:
TIME="`awk '/Segment/ {print $3%secs + $TIME} ' log.txt`"
echo $TIME
It's a silly solution, but I think it may convey what I want to do....
I suspect that it has something to do with reading each line separetely, but I can't figure it out...
Thanks a lot in advance...