Hi,
I'm looking for a batch file or en-script which will convert all hex in a .txt into ascii. I've found one batch script online but it skips large portions of hex. Does anyone have one on hand?
Commercial or open source, all appreciated. Encase / ftk / winhex isnt much use, as it reads the hex as asci (as it should). Unless I'm missing a useful function in winhex (trial) to convert??
Maybe I am missing the point, but just opening the file in a text editor, Like Notepad, UltraEdit or many others will display a binary file as text. Of course many hex values are outside of the ASCII range, so there is no sensible way to display them. So you'll either get a lot of garbage characters, or a lot values skipped, depending on the tool and font in use.
I think your whole idea of *conversion* to ASCII doesn't make sense. ASCII is a just mapping of values in a file to symbols to characters.
The question would make sense, if it was a conversion from UTF-16 to ASCII. Or a conversion from EBCDIC to ASCII. Or maybe you mean something like converting ASCII HTML hex encoded character references to plain unencoded ASCII?
0x48 0x45 0x4c 0x4c 0x4f = HELLO
Hi Passmark,
"ASCII HTML hex encoded character references to plain unencoded ASCII?" - Highly likely. The data was generated by a web-server.
"So you'll either get a lot of garbage characters, or a lot values skipped, depending on the tool and font in use." - Plenty of garbage characters.
I can decode the hex in web based converters, but I need something that can batch recursive on multiple .txt files.
Can you give an example of what the source file looks like (or a link to an example file)
Research1, do I understand that you have a text file that contains the following
48656c6c6f20776f726c6421
And you want to convert that into some one byte character set, e.g., ASCII. That's an interesting question.
Passmark, thanks for participating. And, umm, aren't you a famous rockstar? )
Try this freeware,
http//
(Disclaimer, I have never used it, but the screen shot looks like it might do what we are guessing you want done).
…aren't you a famous rockstar?
Only in my dreams…..
Can you give an example of what the source file looks like (or a link to an example file)
I second this! In the meantime, here's a quick and dirty python 2.x solution assuming your file content is something like this
48656C6C6F20576F726C64
import binascii
hex_content = open("c\\some\\path\\here\\file.txt").read()
ascii_string = binascii.a2b_hex(hex_content)
print ascii_string
hex_file.close()
I had a quick look at doing it in EnScript, but to be honest I find EnScript to be an exercise in frustration with this sort of simple file content processing.
Thanks all for your assistance.
To close this off, in the end I used vb hooked into exel with a macro and converted inside. All the comments assisted greatly though.
I would still like a decent batch script to do this for research, if anyone knows of one.
i just did something similar in .net to process Ares data in the registry for osTriage. while not a batch file, its a very simple loop to do what you want to do and "decode" the files.
do you have what you need at this point?