PDA

View Full Version : How to Join 2 srt subs


philippas
10th March 2002, 05:13
I want to merge 2 srt subtitles of a film into 1 srt file(2cd version-> 1cd version). Is there any tool that can do this ?

thore
11th March 2002, 13:11
You can use Subtitle studio 2.0, easy to use.

Good luck

philippas
11th March 2002, 13:19
I already tried it but it doesn't seem to work. Maybe i'm doing something wrong i'll try it again.

thore
11th March 2002, 14:01
Start Subtitle studio, choose open, choose the first .srt file, then you have 3 button's "edit, join and split" press the join button and pull down the text window till the last row of text, click the checkbox at the last row, now click "join (after breakpoint)"and choose you're next sub, and so on.., when you're done simply press "save as" and voila!

Hope it's readable

Good luck

bugmenotwillyou
11th July 2005, 19:39
i wrote a litte perl script that does that i will make it available through a website soon if you have perl you can try this
#!/user/bin/perl
use strict;


#---------------------------------------------------
my $newfilename = 'kin_dza_dza_pt2_eng.tmp.srt';
my $newfile;
my ($h,$m,$s,$c);
$h = 1;$m = 3;$s = 27;
$c = 571;
my $filename = 'kin_dza_dza_pt2_eng.srt';

open(FH,$filename)or die "ERROR: Can not access $filename";
while ( !(eof(FH)) ){
my $read = <FH>;
if($read =~ /(\d+):(\d+):(\d+),(\d+) --> (\d)+:(\d+):(\d+),(\d+)/){
my ($x1,$x2,$x3,$x5,$x6,$x7);
#------------------------
$x3 = $3+$s;
if($x3>=60){
$x3 = -(60-$x3);
$x2 = 1;
}else{$x2 = 0}
$x2 += $2+$m;
if($x2>=60){
$x2 = -(60-$x2);
$x1 = 1;
}else{$x1 = 0}
$x1 += $1+$h;

#------------------------
$x7 = $7+$s;
if($x7>=60){
$x7 = -(60-$x7);
$x6 = 1;
}else{$x6 = 0}
$x6 += $6+$m;
if($x6>=60){
$x6 = -(60-$x6);
$x5 = 1;
}else{$x5 = 0}
$x5 += $5+$h;

#------------------------
#$newfile = "$1:$2:$3,$4 --> $5:$6:$7,$8\n";
$newfile .= sprintf ("%02d:%02d:%02d,%03d --> %02d:%02d:%02d,%03d\n",$x1,$x2,$x3,$4,$x5,$x6,$x7,$8);
#print "$newfile\n\n";
}elsif($read =~ /^(\d+)$/){
$newfile .= "".$1+$c."\n";
}else{
$newfile .= "$read";
#print "$newfile\n";
}

}
close(FH);
open(FH,">$newfilename")or die "ERROR: Can not access $filename";
print FH $newfile;
close(FH);
print "Done!"

ai4spam
12th July 2005, 05:05
SubtitleWorkshop and SubEdit do it nicely (with offset extracted automatically from the first .avi, and so on).

bugmenotwillyou
14th July 2005, 00:56
i finished the online version which is a little raw but in case you don't want to dl some program i think it will be suficient http://submerge.delarue-berlin.de/