Kenneth R. Irwin wrote:
> Hi folks,
>
> I just started tinkering with Expect to talk to our OPAC, and I'm finding
> that when I look at the resulting log files I get a lot of garbage
> characters eg:
> [H[2J[1;11H*** INNOPAC
> (for more see log: http://www6.wittenberg.edu/lib/logfile.txt )
>
> I see these characters in more, emacs, web browsers, etc. But curiously, I
> don't see them in "grep" results (although I do see them if I pipe grep
> results to a logfile of their own.) This makes me think that the computer
> knows they are funny characters in some way, which gives me some hope that
> they are filterable.
Those look like ANSI escape characters (used to control things like
colour and move the cursor position). They should actually start with an
escape character (ASCII 27 or ^[) which may not be displaying. For
example, ESC[2J is the ANSI code to clear the screen and move the cursor
to the home position. ESC[1;11H means move the cursor to line 1, column 11.
A quick Google search for "ansi escape codes" shows some pages that
might be helpful in deciphering them.
--
William Wueppelmann
Electronic Systems Specialist
Canadian Institute for Historical Microreproductions (CIHM)
http://www.canadiana.org/
|