On Fri, May 28, 2010 at 9:54 AM, Michael Chaney
<[email protected]>wrote:

> perl -p -i -e 'chomp; s/\r(?!\n)/\n/g; print;' files-to-fix
>

For the record:  print is not recommended with in Perl place editing.  It
will duplicate the lines. For a CR line terminated file, the whole file is
read at once so it is like cat filename filename >> filename2; mv filename2
filename;.  (Or if you pass a LF or CR/LF terminated file, print with in
place edit duplicates each line as it goes.)  Neither is likely desired.

The chomp does nothing for CR line terminated files (and would delete
Linux/DOS line terminators if you accidentally process a LF or CR/LF file.)

-- 
You received this message because you are subscribed to the Google Groups 
"NLUG" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nlug-talk?hl=en

Reply via email to