time modification in script

Hi All..

I have a file with a number of non-unique entries as below:

1243
01:42:29,567 --> 01:42:32,108
blah blah ....
blah blah ..

1244
01:42:32,709 --> 01:42:34,921
blah blah ....

1245
01:42:35,214 --> 01:42:36,533
blah blah ....
blah blah ..
blah blah ....
blah blah ..

Question is: How can I modify these timings in hh:mm:ss format. Say if I need to add/subtract 30 seconds throughout the file.

I tried to start with this:

cat title | grep "\-\-\>" | awk -F"-->" '{print $1 $2}'
00:07:59,651 00:08:00,379
00:08:34,417 00:08:35,518
00:08:36,892 00:08:38,094

cat title | grep "\-\-\>" | awk -F"-->" '{print $1 $2}'

##VARIABLES hour, minute, second:
hour1=`cat title | grep "\-\-\>" | awk -F"-->" '{print $1 $2}' | cut -c 1,2`
hour2=`cat title | grep "\-\-\>" | awk -F"-->" '{print $1 $2}' | cut -c 15,16`

min1=`cat title | grep "\-\-\>" | awk -F"-->" '{print $1 $2}' | cut -c 4,5`
min2=`cat title | grep "\-\-\>" | awk -F"-->" '{print $1 $2}' | cut -c 18,19`

sec1=`cat title | grep "\-\-\>" | awk -F"-->" '{print $1 $2}' | cut -c 7,8`
sec2=`cat title | grep "\-\-\>" | awk -F"-->" '{print $1 $2}' | cut -c 21,22`

secnew1=`expr $sec1 + 30`
echo $secnew1

But got ERROR ALL AROUND.

AWK or SED preffered.
Or at least provide the logic.

Thanks a lot

I get time using

awk -F"-->" '/\-\->/{ print $1 }' title  | awk -F, '{ print $1}'

just use a loop and date command to add 30 sec ... it will take care of mins hrs etc ..

So..

INPUT:
01:42:29,567 --> 01:42:32,108

How can I assign values as:
var1=01:42:29
var2=01:42:32

just say VAR1=$(awk... ) etc ..

---------- Post updated at 03:04 AM ---------- Previous update was at 02:59 AM ----------

For the first part of time

for file in $( awk -F"-->" '/\-\->/{ print $1 }' title | awk -F, '{ print $1}' ) ; do  echo -n "$file --->"; date --date="1970-01-01 $file JST +30 seconds" +%H:%M:%S; done

for scnd part

for file in $( awk -F"-->" '/\-\->/{ print $2 }' title | awk -F, '{ print $1}' ) ; do  echo -n "$file --->"; date --date="1970-01-01 $file JST +30 seconds" +%H:%M:%S; done

Thanks for spending your time but....
Below is the message I am getting:

-n 01:42:32 --->
date: illegal option -- -
Usage: date [-u] [+format]
date [-u] [mmddhhmm[[cc]yy]]
date [-a [-]sss.fff]
-n 01:42:34 --->
date: illegal option -- -
Usage: date [-u] [+format]
date [-u] [mmddhhmm[[cc]yy]]
date [-a [-]sss.fff]
-n 01:42:36 --->
date: illegal option -- -
Usage: date [-u] [+format]
date [-u] [mmddhhmm[[cc]yy]]
date [-a [-]sss.fff]

Why do we use below lines:
date --date="1970-01-01 $file JST +30 seconds" +%H:%M:%S