[SATLUG] hex replacemnent in vi

Borries Demeler demeler at biochem.uthscsa.edu
Sat Nov 8 11:46:12 CST 2008


How do I replace a hex character in a text file with vi?
Normally, to globally replace a string I do:

:%s/string1/string2/g

But how do you represent the string if it is not an ASCII character,
but some binary code in the file, say 0xA0 (octal: 240, decimal: 160)?

To get rid of it, I tried:

:%s/0xA0//g

or 

:%/\xA0//g

but that didn't work. Suggestions?

Thanks,
-b.


More information about the SATLUG mailing list