PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > convert 8086 relocatable file to ascii text
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

convert 8086 relocatable file to ascii text

Réponse
 
LinkBack Outils de la discussion
Vieux 12/11/2007, 12h13   #1
Atropo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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

  Réponse avec citation
Vieux 12/11/2007, 12h30   #2
Atropo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: convert 8086 relocatable file to ascii text

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

  Réponse avec citation
Vieux 12/11/2007, 13h58   #3
Bill Marcum
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: convert 8086 relocatable file to ascii text

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.
  Réponse avec citation
Vieux 12/11/2007, 14h22   #4
Atropo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: convert 8086 relocatable file to ascii text

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

  Réponse avec citation
Vieux 12/11/2007, 14h46   #5
Steven Mocking
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
Vieux 14/11/2007, 13h21   #6
Atropo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: convert 8086 relocatable file to ascii text

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.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 14h19.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,17704 seconds with 14 queries