LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-21-2007, 05:04 AM   #1
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Read/convert hyperterminal data file


I have some data that's in an odd file format (extension .ht), which according to file is hyperterm data. I've looked at the corresponding section of /usr/share/file/magic to see what it says about these files, and see the following:
Code:
# Hyper terminal:
0       string  HyperTerminal\  hyperterm
>15     string  1.0\ --\ HyperTerminal\ data\ file      MS-windows Hyperterminal
www.filext.com says it's a HyperTerminal Data File from Hilgraeve Inc., and gives this identifying information for it:
Code:
Hex: 
48 79 70 65 72 54 65 72 6D 69 6E 61 
6C 20 31 2E 30 20 2D 2D 20 48 79 70 
65 72 54 65 72 6D 69 6E 61 6C 20 64 
61 74 61
ASCII: HyperTerminal 1.0 -- HyperTerminal data
The data within the file can be seen by TextEdit on OS X without any problems, but I'd like to be able to write a script to format the data as I need it. The first step in that process though is being able to read the file!
I've tried od, strings and tr, but nothing produces a sensible output.

Does anyone have any experience of this format? Are there any conversion utilities?
 
Old 12-03-2007, 03:23 AM   #2
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Original Poster
Rep: Reputation: 128Reputation: 128
Just a little bump...
 
Old 12-03-2007, 03:51 AM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
If you can provide an example of what the .ht file looks like, and how you want the output to look it would help.
 
Old 12-03-2007, 04:23 AM   #4
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Original Poster
Rep: Reputation: 128Reputation: 128
At the moment, I'm having trouble even reading the file - the formatting part I'll do with a mixture of sed, awk, tr etc.

If I open the file in less, for example, I get this:
Code:
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^A^@^D^@^@^@e
^@^@^@^P^@^D^@^@^@Fax^@^Q^@H^A^@^@d^@^@^@^A^@^@^@^B^@^@^@^@^@^@^@^@^@^@^@^A^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^A^@^@^@^A^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^A^@^@^@ANSI^@^@5^@9^@ ^@L^@L^@D^@ ^@2^@8^@ ^@6^@0^@0^@s^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^A^@^@^@^@^@^@^@^@^@^@^@
&^P^@^@^@^@^@^@^@^@^@^@��^G^@�FEg^A^@^@^@&^P^@^@^D^@^@^@��^G^@��^G^@�O^C^@^D^@^@^@�
�^G^@*^A^@^@^@^@^@^@^@^@^@^@��^G^@�FEg^A^@^@^@*^A^@^@^D^@^@^@8M^C^@�O^C^@ M^C^@^D
          ^A^@^@��^G^@�^XEg�O^C^@��^G^@-dDg^A^@^@^@*^A^@^@^D^@^@^@8M^C^@"^@<^@^@^@����^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@�^@^@^@^@Courier New^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@#^@^P^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@$^@^D^@^@^@d^@^@^@A^@
^D^@^@^@,^@^@^@B^@^F^@^@^@01767^@C^@^A^@^@^@^@D^@^D^@^@^@�u!ZF^@^D^@^@^@^A^@^@^@
G^@^D^@^@^@^@^@^@^@H^@^@^A^@^@COM1^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
biosh\ conc\ G\ 1K0.59\ LLD\ 28\ 600s.ht
In vim -b:
Code:
HyperTerminal 1.0 -- HyperTerminal data file^M
Please do not attempt to modify this file directly.^M
^M
^M
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
"biosh conc G 1K0.59 LLD 28 600s.ht" [noeol] 6L, 23305C      1,1           Top
I've tried looking for Windows utilities to read this data, but nothing seems to work. The only thing that displays it correctly is TextWrangler/TextEdit on a Mac - I can't remember which is was because I don't have a Mac.

I just want to convert it to a plain text file that I can use with sed, awk, grep etc.
 
Old 12-03-2007, 06:23 AM   #5
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Try running "strings" on the file to see if there is any information which you are interested in which is encoded as regular strings. (e.g. phone numbers, user names and so on).

If you can't extract what you want that way, I think you're in for a hard time. You might be able to find some technical documentation about how to extract the information out of it, but that is a matter of asking for the documentation from Microsoft. Even if you find some documentation, you'll have to write a program to read these files.

Unless of course there is already one out there in Linux land. I didn't find one with a google query, but maybe I'm not searching with the correct terms.

Last edited by matthewg42; 12-03-2007 at 06:24 AM.
 
Old 12-03-2007, 07:04 AM   #6
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Original Poster
Rep: Reputation: 128Reputation: 128
The output of strings is:
Code:
HyperTerminal 1.0 -- HyperTerminal data file
Please do not attempt to modify this file directly.
ANSI
-dDg
Courier New
01767
u!ZF
COM1
        Terminal
x8Hg
There should be several columns of data (a series of numerical values), so strings is a no go.

I think I'll ask for someone with a Mac to copy the text into a new plain text file, and then work with those.

It's not my data (this is more of a favour) so I'm not going to learn C in order to write a program to read these files! Although it has somewhat piqued my interest...
 
Old 12-03-2007, 07:35 AM   #7
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
On occasions when I've had to cobble something together to read binary file formats, I usually have used perl because of the really easy-to-use and reasonably fast pack and unpack functions. Of course, it's still necessary to somehow find out the structure of the data to use these.
 
Old 12-03-2007, 01:37 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
I am a little confused.
*.ht are just configuration files used to setup hyperterminal. i.e. configure buad rate, com port, modem settings etc. etc.

If you used hyperterminal to capture data then it should be stored in the
file designated when you selected capture text. Captured text is basically anything that comes over the comm port so it could be binary or ASCII text data. One can also transfer data via a download protocol i.e xmodem or zmodem.

From your last post it appears that your friend did not provide you with the real data.
 
Old 12-03-2007, 04:27 PM   #9
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Original Poster
Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by michaelk View Post
From your last post it appears that your friend did not provide you with the real data.
Yes, that's what I'm thinking. Unfortunately, these are the results of some experiments he's been conducting, so it would be a lot of work to redo them. I'll see if he can just copy and paste the text out into a plain text file, whereafter I'll be able to work on them as normal.
 
Old 12-03-2007, 04:48 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Hopefully he still has the data files on the computer.
Hyperterminal is a useful tool to capture serial port data using a windows PC. If the data is
ASCII text characters it should be easy to work with them. I use hyperterminal frequently to capture debug data from avionics equipment.
 
Old 12-04-2007, 12:33 AM   #11
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
For the record, I think the closest Linux equivalent to hyperterminal is minicom.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
looking for a perl script to convert html table data into a csv file swiftguy121 Linux - Software 2 04-25-2007 07:28 PM
How to read HTML or TXT file and output the data? koolkicks311 Programming 1 04-20-2007 11:13 PM
libpopt.so.0: cannot read file data agustingp7 Linux - Desktop 2 11-22-2006 07:27 AM
Program Crash Data, core.5169 file, how do I read it GlennsPref Linux - Software 11 10-31-2006 01:04 AM
How to read data from file to use in shell script? ozymandias Linux - Newbie 7 10-27-2006 01:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration