perl -p -e 's/\r$//' < dosfile.txt > unixfile.txt #### perl -p -e 's/$/\r/' < unixfile.txt > dosfile.txt