Hi,
I have a subtitle track something like this.
1
00:01:18,700 --> 00:01:20,660
Hi.
2
00:01:27,040 --> 00:01:30,380
-How'd it go?
-Lousy.
3
00:01:30,460 --> 00:01:34,300
Got a '63 Thunderbird
I would've sold in a day a year ago.
4
00:01:34,330 --> 00:01:37,050
Now they just wanna look at the pictures.
5
00:01:37,470 --> 00:01:39,840
You smell nice.
6
00:01:44,140 --> 00:01:45,680
How was your day?
7
00:01:45,890 --> 00:01:47,480
It was great.
I want to add few seconds to the time frame. like 30 seconds
00:01:18,700 --> 00:01:20,660
should become like
00:01:48,700 --> 00:01:50,660
and
00:01:44,140 --> 00:01:45,680
should become like
00:02:14,140 --> 00:02:15,680
and
00:59:44,140 --> 00:59:45,680
should become like
01:00:14,140 --> 01:00:15,680
Can any one please help me
Looks like movie's subtitles.
gawk -v i=30 'function t(x){ split(x,a,":|,")
str=mktime("2011 1 1 " a[1] FS a[2] FS a[3])+i
return strftime("%H:%M:%S",str) "," a[4]}
/-->/ {$1=t($1);$3=t($3)}1' infile
1
00:01:48,700 --> 00:01:50,660
Hi.
2
00:01:57,040 --> 00:02:00,380
-How'd it go?
-Lousy.
3
00:02:00,460 --> 00:02:04,300
Got a '63 Thunderbird
I would've sold in a day a year ago.
4
00:02:04,330 --> 00:02:07,050
Now they just wanna look at the pictures.
5
00:02:07,470 --> 00:02:09,840
You smell nice.
6
00:02:14,140 --> 00:02:15,680
How was your day?
7
00:02:15,890 --> 00:02:17,480
It was great.
As you said, it was a movie subtitle. And as the movie subtitle says, 'your code 'It was great.
I have a pseudo-UNIX environment for Windows.Using which i can edit the subtitles to sync it with video ......
Good confirmation, in fact this code (the function part) can be used for general time difference calculation.