If you open unix text files in windows there are strange characters appearing instead of text. The same happens if you open dos text files in unix you will see strange characters like ^M at the end of each line. you can use dos2unix program to convert these dos files into unix text file format.
usage
$dos2unix file.txt
converts file.txt from Dos format to unix format and replaces it. You can also use fromdos to same the thing
$fromdos file.txt
There is another command unix2dos to reverse the task
$unix2dos file.txt
converts file.txt from unix format to dos format and replaces it… you can use todos to do the same task as
$todos file.txt