convert 8086 relocatable file to ascii text

Hi all.

tried to convert what I supposed was an ebcdic file with dd if=infile
conv=ascii of=ofile, the result file was not ascii text even when the
file command told me so. when i throw a file command to the infile it
says 8086 relocatable. how can I manage this file to convert it to
plain ascii text?

Thanks
Atropo [ Mo, 12 November 2007 13:13 ] [ ID #1868193 ]

Re: convert 8086 relocatable file to ascii text

On 12 nov, 07:13, Atropo <lxvasq... [at] gmail.com> wrote:
> Hi all.
>
> tried to convert what I supposed was an ebcdic file with dd if=infile
> conv=ascii of=ofile, the result file was not ascii text even when the
> file command told me so. when i throw a file command to the infile it
> says 8086 relocatable. how can I manage this file to convert it to
> plain ascii text?
>
> Thanks

Sorry, this is ksh on AIX 2 5
Atropo [ Mo, 12 November 2007 13:30 ] [ ID #1868194 ]

Re: convert 8086 relocatable file to ascii text

On 2007-11-12, Atropo <lxvasquez [at] gmail.com> wrote:
> Hi all.
>
> tried to convert what I supposed was an ebcdic file with dd if=infile
> conv=ascii of=ofile, the result file was not ascii text even when the
> file command told me so. when i throw a file command to the infile it
> says 8086 relocatable. how can I manage this file to convert it to
> plain ascii text?
>
> Thanks
>
od -tx1z infile (that's a "one" in "-tx1z")
strings infile
If those commands don't give any readable output, post the output of
od -tx1z and the original name of the file.
Bill Marcum [ Mo, 12 November 2007 14:58 ] [ ID #1868195 ]

Re: convert 8086 relocatable file to ascii text

On 12 nov, 08:58, Bill Marcum <marcumb... [at] bellsouth.net> wrote:
> On 2007-11-12, Atropo <lxvasq... [at] gmail.com> wrote:> Hi all.
>
> > tried to convert what I supposed was an ebcdic file with dd if=infile
> > conv=ascii of=ofile, the result file was not ascii text even when the
> > file command told me so. when i throw a file command to the infile it
> > says 8086 relocatable. how can I manage this file to convert it to
> > plain ascii text?
>
> > Thanks
>
> od -tx1z infile (that's a "one" in "-tx1z")
> strings infile
> If those commands don't give any readable output, post the output of
> od -tx1z and the original name of the file.

that was just superb Bill, now I'm kind of depressed, i've never
heard about od either strings. just staring as my ignorance grows in
front of you.. Thanks a lot
Atropo [ Mo, 12 November 2007 15:22 ] [ ID #1868196 ]

Re: convert 8086 relocatable file to ascii text

Atropo schreef:
> Hi all.
>
> tried to convert what I supposed was an ebcdic file with dd if=infile
> conv=ascii of=ofile, the result file was not ascii text even when the
> file command told me so. when i throw a file command to the infile it
> says 8086 relocatable. how can I manage this file to convert it to
> plain ascii text?

Unless it came from an old IBM mainframe, it's not very likely that it's
an EBCDIC file in the first place. Especially not if it looks like an
executable and dd conv=ascii does not return ascii characters. What
makes you think it is a text file anyway? And why should it be in the
EBCDIC format?

If it's actually a binary file, this is no longer a specific question.
There's lots of ways, with very different results. You can encode the
file in any arbitrary base that can be translated to readable
characters, such as base 8, 16 or 64. For that, see man od, hexdump and
uuencode.

Another thing you might want is print all the readable strings in the
file with "string". Keep in mind that this is usually only a small
fraction of the file.

Not to mention other possibilities, but my crystal ball has coffee
stains, so you'll just need to enlighten us yourself.

Regards,
Steven
Steven Mocking [ Mo, 12 November 2007 15:46 ] [ ID #1868199 ]

Re: convert 8086 relocatable file to ascii text

On 12 nov, 09:46, Steven Mocking
<u... [at] youmightwanttogetridofthis.quicknet.nl> wrote:
> Atropo schreef:
>
> > Hi all.
>
> > tried to convert what I supposed was an ebcdic file with dd if=infile
> > conv=ascii of=ofile, the result file was not ascii text even when the
> > file command told me so. when i throw a file command to the infile it
> > says 8086 relocatable. how can I manage this file to convert it to
> > plain ascii text?
>
> Unless it came from an old IBM mainframe, it's not very likely that it's
> an EBCDIC file in the first place. Especially not if it looks like an
> executable and dd conv=ascii does not return ascii characters. What
> makes you think it is a text file anyway? And why should it be in the
> EBCDIC format?
>
> If it's actually a binary file, this is no longer a specific question.
> There's lots of ways, with very different results. You can encode the
> file in any arbitrary base that can be translated to readable
> characters, such as base 8, 16 or 64. For that, see man od, hexdump and
> uuencode.
>
> Another thing you might want is print all the readable strings in the
> file with "string". Keep in mind that this is usually only a small
> fraction of the file.
>
> Not to mention other possibilities, but my crystal ball has coffee
> stains, so you'll just need to enlighten us yourself.
>
> Regards,
> Steven

Thanks for your points Steven and I apologize for not reply to your
comments quickly. in fact the file came from an IBM mainframe. I
could find the ftp to get this file. it has

expect -re {.*\:.*\> } {send "quote mode b\r"}
expect -re {.*\:.*\> } {send "quote type i\r"}
expect -re {.*\:.*\> } {send "bin\r"}

I changed the bin parameter to ascii and catch it again. but it came
unreadable too.
Atropo [ Mi, 14 November 2007 14:21 ] [ ID #1869971 ]
Linux » comp.unix.shell » convert 8086 relocatable file to ascii text

Vorheriges Thema: At least
Nächstes Thema: a simple but strange problem