Convert Windows/DOS text file to Unix/Linux and vica verca

From ben.goodacre.name/tech

Jump to: navigation, search

A text-file created in Windows/DOS may appear incorrectly on Unix/Linux depending on how it transferred - some programmes do the conversion automatically. Convert Windows/DOS text file to Unix/Linux:

tr -d '\15\32' < dosfile.txt > unixfile.txt
Convert Unix/Linux text file to Windows/DOS:
sed 's/$'"/`echo \\\r`/" unixfile.txt > dosfile.txt
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox