convert 8086 relocatable file to ascii text
convert 8086 relocatable file to ascii text
am 12.11.2007 13:13:55 von Atropo
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
Re: convert 8086 relocatable file to ascii text
am 12.11.2007 13:30:54 von Atropo
On 12 nov, 07:13, Atropo 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
Re: convert 8086 relocatable file to ascii text
am 12.11.2007 14:58:28 von Bill Marcum
On 2007-11-12, Atropo 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.
Re: convert 8086 relocatable file to ascii text
am 12.11.2007 15:22:39 von Atropo
On 12 nov, 08:58, Bill Marcum wrote:
> On 2007-11-12, Atropo 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
Re: convert 8086 relocatable file to ascii text
am 12.11.2007 15:46:40 von Steven Mocking
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
Re: convert 8086 relocatable file to ascii text
am 14.11.2007 14:21:06 von Atropo
On 12 nov, 09:46, Steven Mocking
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.