begin quoting boblq as of Thu, Jun 16, 2005 at 12:51:53PM -0700: > OK, one good vi question deserves another. > > I seem to get 0xA0 i.e. hex A0 often in files where spaces > should be. I can remove them with something like > cat file.txt | tr "\240" " " >file.txt.clean
Hm... That's not ASCII, and there's no "man ansi".
> I would like to use the substitute command in vi
> but cannot figure out how to hit on an arbitrary
> hex character. Anyone know the incantation?
Wouldn't "%s/^V_/ /g" work, where _ is the actual value of that
character, typed in the way you'd generate they character on the
keyboard normally? (e.g. some sort of alt-keypad entry)
Hm.
You could also piple the paragraph/document through tr from
within vi to 'clean' it. For example, in command-mode (i.e.
edit mode, not ex-mode):
!}tr "\240" " "
Will run the current paragraph through tr.
Use "!G" instead of "!}" to get the whole document. Wrap the
tr-expression into a script ("foo") so you just have to type
!Gfoo^M to "fixup" the whole document. Find a key-combo you
don't use and use :map to map that key-combo to do this.
-Stewart "There ought to be a way to do it entirely within vi" Stremler
pgpR1UDiqJcSl.pgp
Description: PGP signature
-- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
