[HPADM] SUMMARY:Perl or Hexdump question

From: Wouter (drempeltje@softhome.net)
Date: Wed Mar 26 2003 - 13:25:23 EST


Hello,

Thanx to Edward who said: 'Have you tried 'od -x' already?'
Thanx to Thierry who said: 'what aboud "hd"; hd < textfile; hd < textfile |
cut -b 10-57'

But this was not what i mend. I already succeeded to covert de data and
filter out the CR/LF's. The problem was the 'OUT,"test.hex" or die;' command
of Perl, this generates a textfile instead of a file who looks like below in
the hex-editor.

I didn't come to a conclusion yet.

Regards,
Wouter van Til

Sent: Sunday, March 16, 2003 22:04
Subject: [HPADM] Perl or Hexdump question
> This is not realy a HPUX question but i try it anyway.
> I have a nice unix-job, it must be very simple but i can't come till a
> simple solution.
> The problem is:
> I want to convert a textfile to a normal file.
> I have the following input in a textfile:
> 52 65 05 00 ab 20 31 30 30 30 00 6a 65 0a 00 9f
> 20 31 36 2c 36 38 3a a0 20 9d 20 88 20 31 30 30
> 30 30 00 8a 65 0f 00 54 31 24 ca e6 28 32 33 29
> bd e6 28 31 30 29 bd e6 28 31 38 30 29 bd e6 28
> 30 29 00 aa 65 19 00 54 32 24 ca e6 28 32 33 29
> bd e6 28 31 30 29 bd e6 28 31 32 30 29 bd e6 28
>
> I want to convert this to a file with hexadecimal the same output as
above,
> so if i open the converted file in a hexeditor it has to look like the
file
> above.
>
> I think this is maybe possible with the hexdump command.
> Of course it is possible with a perl program.
> I started with a program, it reads the textfile and strips out the
> whitespace and CR/LF.
> But if i create a file with open OUT,"test.hex" or die; and i print
the
> hex-characters to it, they are in ASCII again.
>
> Does somebody can give me a hint or solution?
>
> Regards,
> Wouter van Til

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:27 EDT