| pier0pieru@yahoo.it 2005-02-10, 5:58 pm |
| I know my ego will be zeroed by a shower of one-liners, anyway, here's
my question. To be completely frank, I was trying to shift the timings
in a subs file. The images are off by 10 seconds, so I needed to change
every occurrence like hh:mm:ss (e.g.: 01:12:55) to hh:mm:tt, where
tt=ss+10. With the additional problem, of course, that tt+10 might be
>59 and the excess seconds should be converted into minutes etc.etc.
Now the math is quite easy, but: is there an efficient tool like sed to
replace text in a stream of ascii AND at the same time capable of some
rudimentary arithmetics? Or else, my only option is to write a script
in bash? I can do it (well, give me the time to learn some bash) but I
was curious about the options. Thank you!
Piero
|