Created
April 8, 2009 16:27
-
-
Save c9s/91853 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/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