File format conversion - HEX/Decimal into Bin

Thread Starter

eblc1388

Joined Nov 28, 2008
1,542
Does anyone know of an utility to convert a simple text file (with hex or decimal representation, delimited by space or comma) into the binary equivalent?

Most of my search in Google using "HEX to binary" turns up conversion programs which gives me conversion to "00110010" which is not what I wanted.

 

Attachments

Thread Starter

eblc1388

Joined Nov 28, 2008
1,542
Thanks t06afre.

I have used several hex editors in the past and none of them does that.

I don't want an hex editor, as it will simply load the text file up for edit as if it is a binary file. I've attached the file if anyone would care to try.

By the way, the Hackman's calculator in your link isn't free and its size of 20MB download so I would give it a miss unless I'm 100% sure that it can actually does what I wanted.
 

Attachments

t06afre

Joined May 11, 2009
5,934
I am not sure what you want to do. In this editor you can type in both ASCII char (to the right), or bytes in form of hex number to the left. Both sides will be updated then you type in info
The dwnload is 9.7 Mbyte not 20 ;)
 

Thread Starter

eblc1388

Joined Nov 28, 2008
1,542
I am not sure what you want to do. In this editor you can type in both ASCII char (to the right), or bytes in form of hex number to the left. Both sides will be updated then you type in info
The dwnload is 9.7 Mbyte not 20 ;)
Type it in manually? :confused:

Now I understand why you have said most HEX editor does that.

I was hoping there are some command line utility that let me do the conversion without typing.
 

DonQ

Joined May 6, 2009
321
I think when (old) DOS debug loads a file with a ".hex" extention, it converts it to binary when it loads it to memory. It then converts it back to hex and ascii to display the values on the screen. (It may need to be in 'intel.hex' form, or something similar. That would be an easy edit.)

If you load it into debug, and then save it with a ".bin" extension, using debug commands, I think that will get what you want. Debug commands would be under help for that program, or available online.

Although finding a utility to do this same thing should be easy, I don't know of a particular one by name. If I need it, I would just write a short program to fscanf(...), then fputc(), or something similar.
 
Last edited:

t06afre

Joined May 11, 2009
5,934
Although finding a utility to do this same thing should be easy, I don't know of a particular one by name. If I need it, I would just write a short program to fscanf(...), then fputc(), or something similar.
Lol I think I did this as a lab assignment in C programming many years ago. It should be easy to make a console program in windows or linux doing this. To day I only use Labview so I can not help. As long as you do not use Labview your self
 

DonQ

Joined May 6, 2009
321
Lol I think I did this as a lab assignment in C programming many years ago. It should be easy to make a console program in windows or linux doing this. To day I only use Labview so I can not help. As long as you do not use Labview your self
A lab assignment?!:eek: Really?

There's about 48 seconds of your life you'll never get back :D
 

t06afre

Joined May 11, 2009
5,934
A lab assignment?!:eek: Really?

There's about 48 seconds of your life you'll never get back :D
Now now no need to be cocky:rolleyes:. This was one of the first assignments in a programming introduction class. Everybody has to start from zero at some point.
 
Top