Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: harris@zk3.dec.com (Bob Harris)
Subject: Re: Convert binary to ascii
Date: 1998/05/14	[thread overview]
Message-ID: <harris-ya023680001405980949570001@usenet.pa.dec.com> (raw)
In-Reply-To: 6j9ukg$c3l$1@nnrp1.dejanews.com


In article <6j9ukg$c3l$1@nnrp1.dejanews.com>, c-willden@mail.dec.com wrote:

>I would like an ascii dump of a binary file. I do
>not need to maintain the integrity of the file, I just want to be able to read
>it.  I did strings, but I'm not sure that I got the entire file.  Also, I
>don't want all the numerical output that vmses dump command gives me (I don't
>use vms very much, so maybe the dump command would have given me what I
>wanted.)

Sounds like you want something cheap and dirty.  Try

    tr -c '[:print:]' '.' <binary_file >ascii_dump

The -c option tells 'tr' to select the characters that do not match the
first string.  The first string '[:print:]' specifies all printable
characters, so all non-printable characters will be selected.  The second
string tells 'tr' to replace selected characters with a period (you may use
any replacement character you like - such as a space ' ').  'tr' reads
stdin and writes to stdout so you have to use I/O redirection to get it to
read your binary file.

Give it a try.  If it is not what you want them maybe reading the man page
on 'tr' will give you some other ideas.

-- 
To get random signatures put text files into a folder called �Random
Signatures� into your Preferences folder.



      reply	other threads:[~1998-05-14  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-12  4:00 Convert binary to ascii c-willden
1998-05-14  4:00 ` Bob Harris [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox