in reply to Convert numbers from a binary file to texts
I expected a text file that I can understand.
You've explicitly asked perl convert each byte to a number, so you're expectations were naive.
A quick look on the web turns up this page which identifies:
Which you have.
Which you have.
You have 14 zeros; which perhaps means your file doesn't contain an index.
You haven't shown us the data.
The point of that was to make it clear that you cannot "convert binary to text" unless you understand what the binary is.
That means you need to know:
And that is true regardless of whether you read the file using Perl, C, or any other language.
As an aside, I'd bet that -- given the information required -- a Perl script can decode one of these files just as quickly (within a few percent) as a program written in C.
And it would be a whole heap faster to write the Perl version. (Admittedly, this is the type of thing I've been doing week in, week out for a decade or more. :)
(Also, if you post a link to a file in this format, I might have a go at decoding it. I've been sitting here waiting for a simulation to complete for 3 days now, and I'm a little bored.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Convert numbers from a binary file to texts
by FreeBeerReekingMonk (Deacon) on Mar 27, 2016 at 10:31 UTC | |
by BrowserUk (Patriarch) on Mar 27, 2016 at 13:32 UTC | |
by BrowserUk (Patriarch) on Mar 27, 2016 at 10:49 UTC |