$fn=shift;
system ("cp $fn $fn.original");
open(IN,"$fn.original");
open(OUT,">$fn");
while ($line=<IN>) {
    $line=~s/[\n\r]+$/\n/;
    print OUT $line;
}
close(IN);
close(OUT);
