in reply to Removing Carriage returns from text files
This code will remove the \r at the end of the line only. If you want to strip all \r's you will need to do s/\r//; imediatly prior to the print statment.open(INFILE, "< input.txt") or die "Failed to open input: $!\n"; open(OUTFILE, "> output.txt") or die "Failed to open output: $!\n"; binmode(OUTFILE); while (<INFILE>) { print OUTFILE }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Removing Carriage returns from text files
by Kalimeister (Acolyte) on Oct 18, 2001 at 17:39 UTC | |
|
Re^2: Removing Carriage returns from text files
by Anonymous Monk on Aug 18, 2017 at 01:33 UTC |