CRLF to LF
perl -pe 's/\r$//g' < windows_file.txt > unix_file.txt perl -pe 's/(?<!\r)\n/\r\n/g' < unix_file.txt > windows_file.txt