Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
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?
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.
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.
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...
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.