Python dos2unix one liner

Stefan Behnel stefan_ml at behnel.de
Sat Feb 27 11:25:48 EST 2010


@ Rocteur CC, 27.02.2010 10:36:
> cat file.dos | python -c "import
>   sys,re;[sys.stdout.write(re.compile('\r\n').sub('\n', line)) for line in
>   sys.stdin]" >file.unix

See:

http://partmaps.org/era/unix/award.html

Stefan




More information about the Python-list mailing list