Need awk line to strip vt-100 control codes 
Author Message
 Need awk line to strip vt-100 control codes

I'm in need of a awk instruction line (probably only one line will be
needed) that strips vt-100 control codes from a character stream.

All vt-100 control codes I'm concerned about have the pattern:

     <escape, octal 033>   <some-characters-not-letters>    <one-letter>

     example:

     <escape>[2J  (the 4-byte sequence) is for clear screen.

I haven't awk'd in several years, so if someone good with regular
expressions would care to cook up the necessary gsub pattern for
me I'd be really grateful.

Thanx,

Dave



Mon, 04 Jan 1999 03:00:00 GMT  
 Need awk line to strip vt-100 control codes



Quote:
> I'm in need of a awk instruction line (probably only one line will be
> needed) that strips vt-100 control codes from a character stream.

> All vt-100 control codes I'm concerned about have the pattern:

>      <escape, octal 033>   <some-characters-not-letters>    <one-letter>

>      example:

>      <escape>[2J  (the 4-byte sequence) is for clear screen.

Here's one way:

{
    gsub(/\033\[[^a-zA-Z]*[a-zA-Z]/, "");
    print

Quote:
}



Tue, 05 Jan 1999 03:00:00 GMT  
 Need awk line to strip vt-100 control codes


Quote:


>> I'm in need of a awk instruction line (probably only one line will be
>> needed) that strips vt-100 control codes from a character stream.

>> All vt-100 control codes I'm concerned about have the pattern:

>>      <escape, octal 033>   <some-characters-not-letters>    <one-letter>

>>      example:

>>      <escape>[2J  (the 4-byte sequence) is for clear screen.
>Here's one way:
>{
>    gsub(/\033\[[^a-zA-Z]*[a-zA-Z]/, "");
>    print
>}

col -b < infile > outfile

will do the job better (it removes all binary characters) and quicker.

Regards,
Gora



Tue, 05 Jan 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VT 100 screen control

2. Serial port connection with VT-100.

3. What about VT-100 emulation????

4. REAL Control Strip 1.0 - control strips for REALbasic applications

5. 100% private, 100% offshore 100% crap 8347.

6. 100% Offshore, 100% Private, 100% Online 8347

7. Source code to strip line feeds from file

8. need to strip trailing K from ea line

9. extracting top 100 data using awk or sed/perl

10. CW5EE ODBC problem linking to Sage Line 100 accounts

11. Stack manipulations (about 100 lines)

12. Stack manipulations (about 100 lines)

 

 
Powered by phpBB® Forum Software