Convert binary file to ascii
4 stars based on
Free use and distribution. T his program is a simple generic binary to ascii file converter. The binary files structure should be an optional header followed by a succession of records. T his page gets a lot of hits through various search engine keywords, so let me emphasize a few things that this program is not: This is not a Hex Editor: This is not a cracking tool: This is not a disassembler.
This is not a decompiler. Much spoken of, like the Loch Ness monster, such things cannot exist for most programming languages like C. This can be used as a reverse engineering tool for figuring out a file format, but it's not going to be easy Although it bears similarities with the tools above, this program is useful only for converting scientific data written in sequential records.
Say somebody sends you a bunch of files and says: The answer is at the end of the page You select the files you want to convert with the [ Select Files ] button. Obviously, all the files should have the same format. You can try to convert files for which you ignore the format or the length of the records; just try one format after another, the prog displays the resulting header and first record of the first file.
If the files software to convert binary file to ascii simple succession of floats for instancesoftware to convert binary file to ascii you know more or less what to expect, you should find a way after a few tries. Two strings specify the kind of data contained in the optional header and the successive records.
You can specify several software to convert binary file to ascii file formats here we have 'custom', 'MET and 'USA' which are the meteorological data formats for which I originally wrote this programthey are saved when you exit the program. Click on [ New ] to add one or [ Clear ] to remove the one currently selected. In case of error in the format string, the Led turns red and a '?
When you press [ Read All ], all the files you have selected get software to convert binary file to ascii from the beginning and merged to a text file that you can save wherever you want. This program was designed to convert scientific data in a quick and easy way so you can view them in Excel for instanceit's in no way meant to replace a program reading directly the binary files which will always be much faster.
This program is not optimized for speed. You can get about a user interface control by right-clicking it. D etails of the format specification: This program cannot currently read them. C Reads one character same as one byte, except that it will be displayed as a character instead of a value. Note that there are at least 3 standards for defining character strings: Fortran uses fixed length buffers and if the actual string is shorter, the rest is filled with spaces; C uses a terminating 0 value in unlimited memory making for very easy buffer overrunsPascal uses a fixed buffer characters with a preceding byte containing the actual length.
So basically for reading a 30 character string, from Fortran you'd do C30, from C you can't or try C30 or the buffer size, from Pascal you'd do BC I Ignore one byte it's read from the file but not displayed. I will ignore one Kb. Space Spaces inserted between the format characters are ignored, they are allowed for readability. When exchanging files between Unix, Mac and PCs, think about the byte swapping option.
I'm not sure about double float swapping, if it should be 8 bytes or 4. No support for long double either 80 bits or bits. I've written the code but my compiler doesn't support it. No error checking on output string qualifier. Yes, Fortran saves an integer containing the length of the record at the beginning and end of each record. And you most likely need to enable the byte swapping option too O nce you know software to convert binary file to ascii format of your files, it may be a pain to spend time launching BinToAscii each time you need to convert a new one.
Unix traditionally contains a command line utility called od octal dump that does something similar. I wrote a similar command line program called od2. Here's the source code for those interested in compiling it on any C compiler. Other relevant pages or forgotten links: