Filtering escape codes from text files

Filtering escape codes from text files

Post by Super us » Fri, 25 Jan 1991 10:56:50



Can someone please tell me how to filter escape codes
from a text file?

I'm using `cu' to connect to a remote computer which
uses things like reverse video.  The only way I have
of printing anything from this computer is to capture
the entire session to a log file and then edit and
print it.  Editing out escape codes is _extremely_
tedious.  I'm sure there is some simple solution to this
problem (maybe using `tr'?).

I can't read news, only post it, so could you please mail
replies direct to me.  Thanks!

Kas Sommers, Queensland Forest Service

 
 
 

1. sed or awk script to remove escape codes from a text file


   >What would be a shell script in ksh to do this?  I can not seem to
   >get sed to read through a file and remove the escape codes ie PCL (
   >Printer Control Language ) codes.
   >Thanks
You could probably do this with sed if you know all the PCL codes and
remember that sed must use a literal escape character, not '\033' or '\x1b'.
Use ^V ESC if vi is your editor.
But there may already be programs to do this translation, if for some reason
you cannot change the process that generates the PCL code.

Net-Tamer V 1.08X - Test Drive

2. Unix - Frequently Asked Questions (Contents) [Frequent posting]

3. Printer Accounting

4. Text based interface and escape codes?

5. how do i obtain password list?

6. Looking for a text file filter/conversion program....

7. iptables NAT and H.323

8. Filtering out ANSI ESC sequences from text file

9. tcsh filter to evaluate variables in a text file

10. Looking for a text file filter/conversion program....

11. MS-window text file viewer to read a text file in SCO server.

12. Dos Text Files to Linux Text Files