Python script to replace CRLF with LF

Nicola Larosa just mentioned “this little script”:http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/Tools/scripts/crlf.py?view=markup on the “EDU-SIG”:http://mail.python.org/mailman/listinfo/edu-sig mailing list to convert CRLF line endings to LF. I didn’t know pre-written scripts like these existed in the Python distribution, and hadn’t got far enough learning Python to write one of my own. Very useful :-)

1 comment so far ↓

#1 greg strockbine on 04.18.05 at 3:50 am

it’s as easy as using the ‘tr’ command found on any *nix system:

cat file | tr -d ‘\r’ > file2

Leave a Comment