[SATLUG] hex replacemnent in vi

Robert Pearson e2eiod at gmail.com
Sat Nov 8 12:58:05 CST 2008


On Sat, Nov 8, 2008 at 12:02 PM, Borries Demeler
<demeler at biochem.uthscsa.edu> wrote:
> One additional point:
>
> when I use sed on the command line it works like I would
> expect it, just not when I use it as a command from within vi:
>
> sed 's/\xA0//g' in_file > out_file
>
> strips 0xA0 from 'in_file' as I would expect it, but not in vi.
> What am I doing wrong?
>
> -b.
>
>> 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
> I meant to write:
>
> :%s/\xA0//g
>>
>> but that didn't work. Suggestions?
>>
>> Thanks,
>> -b.
>>
>
> --
> _______________________________________________
> SATLUG mailing list
> SATLUG at satlug.org
> http://alamo.satlug.org/mailman/listinfo/satlug to unsubscribe
> Powered by Rackspace (www.rackspace.com)
>


[From the archives]-------------------------------------------------------------------------

from	Borries Demeler <demeler at biochem.uthscsa.edu>
reply-to	The San Antonio Linux User's Group Mailing List <satlug at satlug.org>
to	Kase Saylor <h_oudini at hotmail.com>
cc	Satlug Mailing List <satlug at satlug.org>
date	Thu, Dec 20, 2007 at 4:04 PM
subject	Re: [SATLUG] searching for a hexvalue with vi
mailing list	satlug.satlug.org Filter messages from this mailing list
mailed-by	satlug.org
	
	
Reply
	
	
> I accidentally typed "Ctrl - c" instead of "Ctrl - v". I apologize for=20
> adding confusion to your problem.
>
> -Kase

Bingo!! That did it :-)
Thanks so much for helping me through it - problem solved!


More information about the SATLUG mailing list