Created
January 26, 2016 21:38
-
-
Save parastuffs/d1e1323613327832f270 to your computer and use it in GitHub Desktop.
Output the lines that were modified between two .ass, ignoring the time.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
my $filenameOrig = 'Senkou 06 OK.ass'; | |
my $filenameMod = 'Senkou 06 OK_adpat.ass'; | |
open my $fileOrig, $filenameOrig or die "Could not open $filenameOrig: $!"; | |
open my $fileMod, $filenameMod or die "Could not open $filenameMod: $!"; | |
while( my $lineMod = <$fileMod>) { | |
seek $fileOrig, 0, 0; | |
my $hit = 0; | |
# If it is a sub line | |
if ($lineMod =~ m/\d+,\d+,\d+,,(.*)/) { | |
my $lineModStrip = $1; | |
while( my $lineOrig = <$fileOrig>) { | |
# If it is a sub line | |
if ($lineOrig =~ m/\d+,\d+,\d+,,(.*)/) { | |
if ($lineModStrip eq $1) { | |
$hit = 1; | |
} | |
} | |
} | |
if ($hit == 0) { | |
print $lineMod; | |
} | |
} | |
} | |
close $fileOrig; | |
close $fileMod; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment