Convert Files from Linux/Unix Format to Windows and Vice Versa

With AWK:



awk '{ sub("\r$", ""); print }' windows.txt > unix.txt
awk 'sub("$", "\r")' unix.txt > windows.txt

With TR

tr -d '\15\32' < winfile.txt > unixfile.txt

 

:1,$s/^M//g

 

Leave a Reply

Your email address will not be published. Required fields are marked *