views:

412

answers:

3

On Windows, what is the best way to convert a binary file where the internal structure is unknown less that its contents are ASCII in nature back to plain text?

Ideally the conversion would produce a "human"-readable version. I think the file should contain something like the following:

Date: 10 FEB 2010
House: 345 Dogwood Drive
Exterior: Brick
+3  A: 

In Linux/Unix:

$ strings < unknown.dat > ascii-from-unknown.txt

This is of course not so much a "conversion" as a straight up extraction, by just filtering out the non-ASCII bytes. It's useful quite often, though.

In general, without more knowledge of the file's internal format, I don't think you can do much better.

unwind
I plus'd you up, because forgetting to add the Windows OS was my mistake. Thanks again for all your help.
JustADude
There are Windows versions of strings as well. For example: http://technet.microsoft.com/en-us/sysinternals/bb897439.aspx
shf301
And all strings does it look for 'N' adjacent printable characters so it isn't too difficult to implement yourself.
Martin Beckett
+1  A: 

Depending on what exactly you want to achieve, a hex dump might fit the bill: It's a pure ASCII format that represents the entire file without any loss of data (but being quite wasteful with space).

It is not really human readable, but since you don't explain why you want to do that, it's the best I can offer.

There are several simple tools that produce a hex dump on Windows.

Joachim Sauer
A: 

You can use ms word, after click "open" menu, in "open" dialog please select "recovering text from any type files" options from "file type" combobox, then select the file you need extracted text, final you can get text content in ms word.

If you need batch extract text contents from many binary files, "cz-doc2txt" will help you, it can convert your binary files to text files.

regards
flyaga

flyaga