I have a file that I need to replace the *| and || with just | and can not
seem to get it to go. It either puts in an | every space, or it puts in
multiples of them, how do I fix this?
here's what I have:
sub cleanup{
use strict;
my $file = "/home/web/sales/info/test/custs1";
my $newfile = "/home/web/sales/info/test/fixed.txt";
my $line;
open (OLDFILE, "< $file");
open (NEWFILE, "> $newfile");
while ($line = <OLDFILE>) {
$line =~ s/||/|/mg;
$line =~ s/\*|/|/mg;
print NEWFILE "$line\n";
}
close OLDFILE;
close NEWFILE;
print "$newfile has now been created\n";
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>