[Kc] return vs newline
JYOUNG79 at kc.rr.com
JYOUNG79 at kc.rr.com
Thu Dec 7 08:40:20 PST 2006
Hi,
I'm trying to loop thru paragraphs in a file but evidently the file has
carriage returns instead of newlines so when perl reads it in, it reads
it in as one big line instead of separate paragraphs. Does anyone know
if there's a way to have perl use carriage returns instead so I can
loop thru each paragraph one at a time?
In the past I've used the code below in the shell to change all the
returns in the file itself but I'd like to leave the file the way it is
if possible:
perl -pi -e 's/\r/\n/g' <filename>
Thanks for your help. I'm running this on Mac OS 10.3
Jay
More information about the kc
mailing list