Convert ^M to newline character in text files

Summary:
In vi use the following:

:%s/^M/\n/g

or, when just removing ^M characters:

:%s/^M//g

NOTE: Be sure to create the ^M by typing ctrl+V followed by ctrl+M.

Leave a Reply