Gossamer Forum
Home : General : Perl Programming :

Re: [slappy] Carriage return problems

Quote Reply
Re: [slappy] Carriage return problems In reply to
If there are no leading spaces in the original file then there shouldn't be any in the newly printed file.

Something like this will work fine...

Code:
open OLD, "the old file" or die $!;
open NEW, ">the new file" or die $!;
while (<OLD>) {
chomp;
print NEW substr($_, 0, 77) . "\n";
}
close NEW;
close OLD;
Subject Author Views Date
Thread Carriage return problems slappy 6313 Feb 19, 2003, 4:35 PM
Post Re: [slappy] Carriage return problems
Andy 6186 Feb 20, 2003, 2:07 AM
Post Re: [slappy] Carriage return problems
Paul 6199 Feb 20, 2003, 2:37 AM