editing binary characters in vi/ex

editing binary characters in vi/ex

Post by Reeve Vannem » Fri, 06 Oct 1995 04:00:00



I have a file that has some binary characters in it.  For example,
the following line:

          ?-------?-------?-------?-------?-------?-------?

On my screen that looks like seven "u"s with "^" over them,
separated by a bunch of hyphens.  (Less will give me "<FB>"
instead of the u^).  How can I search and replace the binary
characters wherever they appear in the file?

Thanks,
Reeve Vanneman

Sociology
University of Maryland, College Park

 
 
 

editing binary characters in vi/ex

Post by David Brian Obren » Sat, 07 Oct 1995 04:00:00



> I have a file that has some binary characters in it.  For example,
> the following line:

>           ?-------?-------?-------?-------?-------?-------?

> On my screen that looks like seven "u"s with "^" over them,
> separated by a bunch of hyphens.  (Less will give me "<FB>"
> instead of the u^).  How can I search and replace the binary
> characters wherever they appear in the file?

in vi, have you tried doing this?
:g/\^u/s/\^u/a
where the ^u is the control-u's you wanna get rid of and the
a is what you whanna replace it with.  I'm not sure what an
<FB> is, but I hope this helps....

obrenov

--
Never call a man a fool.  Borrow from him.

 
 
 

editing binary characters in vi/ex

Post by Reeve Vannem » Sun, 08 Oct 1995 04:00:00


OK, I have made some progress on this problem.  The <FB> in less
is hex notation for 251.  Also, ed will list the character as \373
which in octal is 251.

So, I still don't know how to search and replace.

Any help?

Thanks,

: I have a file that has some binary characters in it.  For example,
: the following line:

:           ?-------?-------?-------?-------?-------?-------?

: On my screen that looks like seven "u"s with "^" over them,
: separated by a bunch of hyphens.  (Less will give me "<FB>"
: instead of the u^).  How can I search and replace the binary
: characters wherever they appear in the file?

: Thanks,
: Reeve Vanneman

: Sociology
: University of Maryland, College Park

 
 
 

1. vi/ex global editing question

If have a requirement to perform a global edit in vi or ex but cannot find a
way to do it.

I know of plenty of workarounds using shell scripts or awk but not a way to
do this in vi or ex.

I have a text file consisting of a long list of absolute pathnames to files,
one pathname per line, pathnames have a varying number of directory levels.

What I need is a single global edit command that will remove the filename
portion of the pathname and leave the directory name portion.

Does anyone know how this can be achieved in vi or ex. ?

Thanks

2. Um, WJBell, where's your proof that you're running FreeBSD?

3. Strange vi-editing behaviour in editing XF86Config

4. SendMail configuration

5. why doesn#t "set -o vi" enable vi style cmdln editing?

6. What is "sep_bug" in my PPro 150(overclocked to 165)?

7. vi, ex & DEL key

8. Linux on a Dos Partition

9. Ex/Vi problems on OpenServer 5.0.4

10. EX, VI, AWK Guru needed? Mapping?

11. Append file commands for Unix & ex/vi

12. vi/ex help

13. vi / ex and .exrc