Linux – Converting text files between Windows and UNIX

The way textfiles are formatted differs between Windows and Unix. If you open a textfile made in Notepad under unix you will find that it has ^M where there should be a new line.

Convert a text file from Windows/DOS to Unix:

  tr -d '\015' < win-format.txt > unix-format.txt

Convert a text file from unix to Windows/DOS:

  sed -e 's/$/\r/' unix-format.txt > win-format.txt
SOURCE

LINK (Linuxreviews.org)

LANGUAGE
ENGLISH