Operating System - HP-UX
1833767 Members
2256 Online
110063 Solutions
New Discussion

Help reading screen capture text file with embedded control codes

 

Help reading screen capture text file with embedded control codes

Hi,

I need some help trying yo read some screen captures from Hyper Terminal. These files contain standard VT cursor postional codes AKA escape sequences or escape codes. ie: center, tab, newline, underscore, bold etc. I cannot read these files and I have tried every method I know.

Does anyone have any ideas on how I can read these files. One method that used to work in my old VMS days was to issue the 'type' command and the codes would be translated. I cannot find a program that will correctly translate the codes in HP-UX, MS, or Linux. Any help would be greatly appreciated.

Thanks.
8 REPLIES 8
G. Vrijhoeven
Honored Contributor

Re: Help reading screen capture text file with embedded control codes

HI,

Did you try the hp2dos command.

Gideon
G. Vrijhoeven
Honored Contributor

Re: Help reading screen capture text file with embedded control codes

Sorry,

ux2dos.

Gideon
A. Clay Stephenson
Acclaimed Contributor

Re: Help reading screen capture text file with embedded control codes

If all you want to do is view the file then od is your boy. This should be close:

od -A d -t c -v myfile | pg

Man od for details.

Plan B. http://gatekeep.cs.utah.edu/hppd/hpux/Development/Tools/hexedit-0.9.7/

This will allow you to edit the file.
If it ain't broke, I can fix that.

Re: Help reading screen capture text file with embedded control codes

Thanks for the info but none of these suggestions worked enough to be able to actually read the formatted text.

Perhaps a point of clarification is needed.
The embedded coded are cursor placement and format controls. Like when you are using a text based program on a vt200 terminal. These are ansi standard escape sequences that tell the terminal how and where to display the text.
A. Clay Stephenson
Acclaimed Contributor

Re: Help reading screen capture text file with embedded control codes

I clearly don't understand. Od -t c will display all the characters. Any printable ASCII characters will be displayed and all others will be displayed symbolically or as an octal triplet. For example CR (octal 015) will be displayed as "\r".

There is no program that will take a file with embedded terminal sequences and somehow display on another device in a pretty way.

If it ain't broke, I can fix that.
Tom Danzig
Honored Contributor

Re: Help reading screen capture text file with embedded control codes

Try:

cat | col -b

Hoefnix
Honored Contributor

Re: Help reading screen capture text file with embedded control codes

If you use a hyperterm to create a logfile from what was displayed during a session and now you want to view this session?

Maybe putty is a better terminal to capture this logfile because then you will end up with a normal (ascii) text file without control characters.

Regards,

Peter

Download putty:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Rodney Hills
Honored Contributor

Re: Help reading screen capture text file with embedded control codes

If you want to display a file filtering out control characters, then

strings yourfile

If you want to display the text with the control codes displayed as \0nnn, then you can use

cat -t yourfile

If you want to see an octal dump of the file with ascii character representations

od -c yourfile

HTH

-- Rod Hills
There be dragons...