I have a file with some non-printable characters that come up as ^C or ^B, I want to find and replace those characters, how do I go about doing that?
Say you want to replace ^C with C:
Where CtrlVC means type V then C while holding Ctrl pressed. CtrlV lets you enter control characters. |
|||||
|
Removing control symbols only:
Removing non-printable characters (removes non-ASCII characters also):
|
|||||||||||||
|
Try this after saving your file in vim (assuming you are in Linux environment)
|
|||||||||||||
|
You can use the |
|||
|
You can use:
To get the To remove both
|
|||
|
None of the answers here using Vim's control characters worked for me. I had to enter a unicode range.
That unicode range was found on this other post: http://stackoverflow.com/a/8171868/231914 |
|||||
|