Operating System - Tru64 Unix
1753867 Members
7340 Online
108809 Solutions
New Discussion юеВ

per l: How to convert Binary Format data file to Ascii File

 
klenkala
New Member

per l: How to convert Binary Format data file to Ascii File

INPUT FILE IS XXX.BIN.in

Outputfile should be xxx.ASC.in

Need script in perl...

THANKS in Advance
Kumar
6 REPLIES 6
Hein van den Heuvel
Honored Contributor

Re: per l: How to convert Binary Format data file to Ascii File


Hello Kumar,

The thing about a binary file is that they are machine and application dependend with no readily recognizable structure.

You will have to describe the contents of the file in minute detail, and only then can we try to help you.

The description could be as simple as 'fixed length pieces of text with no terminator with size nnn', or as complicated as '3-bits for a segment indicator, 5 bits for a flag, 32 bits for a Binary Code Decimal (Sign overpunch), 129 bits for an IEEE floar, a series of Tag-Length-Value object, and 16 bit 0 terminator for the TLV list,.... and so on.

You will also need to explain what to do with 'non-ascii' data in the data, and preferrably include a bit out sample input (od -X dump if need be) and sample output to match that.

As this point, without knowing anything else, the answer to your question is
'mv XXX.BIN.in xxx.ASC.in'

Hein.
Ross Minkov
Esteemed Contributor

Re: per l: How to convert Binary Format data file to Ascii File

Not sure if this will help you, but you might want to take a look at strings(1):

strings - print the strings of printable characters in files

-Ross
Ralf Puchner
Honored Contributor

Re: per l: How to convert Binary Format data file to Ascii File

question looks funny, because how to interpret the binary data and convert them in ascii if not knowing the destination file format.

If you want to convert the data for mail sending use the "uuencode" command which is the easiest method.

All other solutions make no sense because we don't know anything about the original and destination fileformat.
Help() { FirstReadManual(urgently); Go_to_it;; }
klenkala
New Member

Re: per l: How to convert Binary Format data file to Ascii File

Please find the atatched Binary Doc.
iw ant convert this one to Ascii file.
Ralf Puchner
Honored Contributor

Re: per l: How to convert Binary Format data file to Ascii File

as written previously: if destitination format must be ascii, what kind of format?
(mime, uuencode, raw text information, etc.)

This is not a question regarding converting it is understanding of ascii and binary.
Help() { FirstReadManual(urgently); Go_to_it;; }
Hein van den Heuvel
Honored Contributor

Re: per l: How to convert Binary Format data file to Ascii File


Kumar,

Your attachment failed. Please try again.
And please try again to explain in more detail what you understand about the input file, and what the requirements are for the output file. At this point your question still translates to:
"hammer: how to convert planks to furniture"

So we know what tool you'd like to use (but not why) we know it output some input wood (but no details on how long or wide or quality) and we know some piece of furniture has to come out (but not whether it will become a table or a cupboard).
Where did you find the planks?
Where does the furniture have to fit?

Regards,
Hein.