Wednesday, March 16, 2011

Using vim as a hex editor - replace windows chars

For example: <99> <B0>
:%s/\%x99//g
:%s/\%xB0//g



Switch to hex mode
Open a file in vim, hit escape and type:
:%!xxd

to exit from hex mode
hit escape again and type:
:%!xxd -r

Search Hex using vim
\%xff or [\xff]

Search 44
\%x34\%x34 or [\x34][\x34]


LF:    Line Feed, U+000A
 CR:    Carriage Return, U+000D 

1 comment: