##!/usr/bin/perl # John Hobbs 2007 - www.velvetcache.org $file = $ARGV[0]; open(INFO, "< ".$file); @lines = ; close(INFO); $size = @lines; $counter = 0; $size = $size / 50; open(FILEWRITE, "> NEW".$file); foreach(@lines) { $counter++; if(0 == ($counter % 50) || $counter == @lines) { print "\rProcessing: ["; for($i = 0; $i < ($counter / $size); $i++) { print "+"; } for($i = 0; $i < (49 - ($counter / $size)); $i++) { print "-"; } print "]"; } # Empty paragraph removal $_ =~ s/

\s*<\/p>//mi; if($_ =~ m/^\s*\n$/) { # If the line is just a newline or newline and spaces, scrap it. $_ = ''; } else { # Remove excess spaces $_ =~ s/ //mi; # I get these alot... $_ =~ s/­//mi; } print FILEWRITE $_; } close FILEWRITE; print "\n";