Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Hide control characters in TPU

 
MichelleP_1
Advisor

Hide control characters in TPU

Hi folks,

How can I hide the control characters in a text file when editing with TPU.

Most of the files are created with SET HOST/LOG or TELNET/LOG. I've tried it on Alpha / 8.3 and I64 / 8.3-1h1. I don't currently have access to a v7.x system.

I'm not sure if it's my configuration or if the defaults have changed.

TIA,
Michelle
6 REPLIES 6
John Gillings
Honored Contributor

Re: Hide control characters in TPU

Michelle,

I'm not sure what you mean.

As far as I can remember, TPU always displays a glyph for every character in a file. What it looks like depends on your terminal, or terminal emulator, especially the glyphs for control characters.

What are you seeing, and how would you like it to be different (or what was it like "before")?

Compare what you see on the screen with DUMP/RECORD.
A crucible of informative mistakes
Hein van den Heuvel
Honored Contributor

Re: Hide control characters in TPU

Well you know, those control character are there and meaningful to some. When I use set host/log, more often than not it is precisely to capture all the control characters.

That said I do appreciate the annoyances when you just want to review what was done.

So what to do? Me, I use two workaround BEFORE getting into TPU (or EDT).

1) $ CONVERT/FDL="REC; FORM STREAM" sethost.log sethost.txt

The convert to stream will make the embedded in commands like "$HOW STATUS" be indistinguishable from other new-lines. And it will have the welcome, but odd, side effect of eating leading binary zeroes you'll find in logs.


2) $ perl -pe "s/\0//g;s/\r//g" sethost.log > sethost.txt

-p = loop over input lines, execute commands, and print (modified) lines... to stream-lf files, making embedded characters become line ends.

-e = command in string

s/x/y/g = substitute x by y. g = all of them
s/\0//g = replace all binary zeroes by nothing
s/\r//g = replace all carriage-return bu nothing.

Enjoy!
Hein.

Hoff
Honored Contributor

Re: Hide control characters in TPU

Very little has changed in this area in eons, so I'd look to something local such as the terminal or terminal emulator.

Or you could run the text file through a local or freeware tool to "clean it up", whether through a Perl or php script or C or otherwise-built or acquired tool. Something like the string tool:

http://labs.hoffmanlabs.com/node/875

Here's a reference to a similar behavior. I recall seeing these characters going back a very long time, too. If not all the way back to the beginning.

http://h71000.www7.hp.com/wizard/wiz_7842.html

And as a guess around a completely different (potential) approach, you could try setting the terminal type to a line printer or something similar before you (try to) capture the text. This should reduce the volume of the control characters and escape sequences and control sequences in the output.

Wim Van den Wyngaert
Honored Contributor

Re: Hide control characters in TPU

I found a something I made in the eighties that I modified slightly. It erases all non-printable characters. I tested it on sysuaf and it seems to work.

You edit your file with eve.
You take a second buffer with this procedure (get xxx). Then extend this buffer by going to command line of eve and doing "ext *".

Then place the cursor in the dirty file buffer. Go to the command line and give "tpu eve_clear_nonprint".

Note : this removed the nonprints and the file could be unusable afterwards.

Wim
Wim
MichelleP_1
Advisor

Re: Hide control characters in TPU

I swear I replied with more information last night, but I must have taken too long to compose it. :-( ...

Thanks for the suggestions so far, I'll give them a try, but if I could get it to "hide" the escape characters by default that would be ideal. I'm not really interested in stripping the underlying codes, just hiding them.

I use SET HOST/LOG (and if necessary TELNET/LOG) for documentation and reference purposes.

At prior customer sites, if I edited with TPU the control characters would be hidden. Not gone, just hidden. If I wanted to see them, I could edit the same file with EDT and see , etc.

I was beginning to think that I imagined it, but I found a C.O.V posting from 2006 where someone had the opposite issue - escape characters were not displaying and he wanted them to. http://unix.derkeiler.com/Newsgroups/comp.os.vms/2006-03/msg00493.html.

I have tried both on Eisner and on Alpha and Integrity systems at a customer site.

I have used SmartTerm, eXcursion, and Putty. At my last customer I used eXcursion and sometimes SmartTerm.

I had a former co-worker send me a $SHOW TERM and set my terminal to match and still no joy.

As a "work around", I have been copying screen+history to notepad. Downsides of that are the extra step and sometimes things scroll out of the buffer before I can get them captured.

I have also tried SmartTerm's Capture function, but it disables the ability to copy/paste to the session and that's even more annoying.

Thanks,
Michelle
MichelleP_1
Advisor

Re: Hide control characters in TPU

Hein,

>1) $ CONVERT/FDL="REC; FORM STREAM" sethost.log sethost.txt

That did strip the and , but not and some of (all?) the escape sequences (backward question marks...)

>2) $ perl -pe "s/\0//g;s/\r//g" sethost.log > sethost.txt

I know this will be like sacrilege to you, but I don't have perl set up?

At any rate, I'd rather not strip the codes out altogether.

Thanks for the suggestions though.

Cheers,
Michelle