|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On 12 nov, 07:13, Atropo <lxvasq...@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 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On 2007-11-12, Atropo <lxvasquez@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. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On 12 nov, 08:58, Bill Marcum <marcumb...@bellsouth.net> wrote:
> On 2007-11-12, Atropo <lxvasq...@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 |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
On 12 nov, 09:46, Steven Mocking
<u...@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. |
|
![]() |
| Outils de la discussion | |
|
|