Convert Windows text file to Linux/Unix using Perl

When writing text file on Windows and then opening them in Linux/Unix you will notice that there are some strange characters at the end of every line.

That is because windows using two characthers for the "return" character. This was useful in the DOS day. But today it is useless but windows is still using it. Nobody has given me a good reason why.

Anyway, This can be quite annoying when working on multiple platforms and if you are on Linux/Unix and have a file saved on Windows and need to convert it.

This can easily be done with a small trick with perl

perl -pi.bak -e 's/\r//g' <filename>

A backup of the original file will be kept with the name <filename>.bak

Tagged:  

( Try Multi Commander, A file manager for professionals )

Copyright (c) 2015 - Mathias Svensson