I have a file with times (minutes and seconds), which looks approximately as follows:
02:53 rest of line 1...
03:10 rest of line 2...
05:34 rest of line 3...
05:35 rest of line 4...
10:02 rest of line 5...
...
I would like to replace the time by its equivalent in seconds. Ideally, I would like to run some magical command like this:
:%s/^\(\d\d\):\(\d\d\) \(.*\)/(=\1*60 + \2) \3/g
...where the (=\1*60 + \2)
is the magical part. I know I can insert results of evaluation with the special register =
, but is there a way to do this in the subst part of a regex?