Anyhow, I'm sure any of you Vi guys & gals out there have run into this wonderful issue of having "^M" appear at the end of each line. This is especially true if you work with *nix and Windows or if your co-workers use Windows.
So, to quickly get rid of this in vi enter the following:
:%s/ctrl+V ctrl+M//g
It will display as: ^M
*Note: Do NOT type in shift+6 shift+m. Remember these are special characters and they need to be entered as so.
That's it! And Bob's your uncle!
Alternatively, you can use sed to make the search/replace. Notice the vi code looks pretty much the same as the sed arguments.
Cheers!
No comments:
Post a Comment