How To replace Control-M in all files in a folder

To remove control-M or ^M from all the documents in the current folder run the following,

$> perl -p -i -e 's/^M$//' *

NOTE : Do not copy and paste this text.
You have to type in the test and when you get to the ^M you have to do a CRTL+V then a CTRL+M

Leave a Reply

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