Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env perl
use warnings;
use utf8;
local $|=1;
my @files = @ARGV;
for my $file ( @files ) {
my $out = $file . ".out";
print "Processing $file";
open FH,"<", $file;
open OUT,">", $out;
my ($line,$reserved,$stripped) = (0,0,0);
while( <FH> ) {
print "\r" . $line++ . " " x 20 ;
unless( m#\d{2}:\d{2}\s-\!-\s# ) {
print OUT $_;
$reserved++;
}
else {
$stripped++;
}
}
print "\n";
close FH;
close OUT;
rename $out ,$file;
print "Stripped: " . "-" x $stripped/10 . "\n";
print "Reserved: " . "+" x $reserved/10 . "\n";
print "Moving $out to $file\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.