[SATLUG] searching for a hexvalue with vi

Borries Demeler demeler at biochem.uthscsa.edu
Thu Dec 20 15:27:13 CST 2007


> 
> I just opened up a binary file (in text mode) and tried searching for 
> 'A0' first:
> 
> :%s/xa0
> 
> and it found 33 instances of 'A0' (displayed as 'A '). I then did a 
> search/replace or 0x99 for 0xA0:
> 
> :%s/xa0/x99/g
> 
> And it replaced 33 instances. I then replaced 0x99 with 0xA0 and 33 
> instances were replaced.

Hmm, that's not the way it worked for me. 
> 
> When you actually press Ctrl-c you'll see '^', then when you type 'a' 
> then '0', you'll see an 'A' and a ' '. When you press  x99, 
> you'll see ''. Anyhow, that seems to work for me. Perhaps you could 
> send a snippet of the file?

Yes, that's very generous - I'm attaching a snippet. It has a few empty
fields separated by a comma, but in 3 of them is another character embedded.
If I move the cursor over it in vi and do a "ga" I get 

<| >  <M- >  160,  Hex a0,  Octal 240 

When I search for xa0 i'm not having any luck picking it up though.
I appreciate your help, Kase!

-borries
-------------- next part --------------
,?,?,?,?,,,,,,


More information about the SATLUG mailing list