comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » convert hex string to ascii
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
convert hex string to ascii [message #53368] Sat, 07 April 2007 08:42
rkombiyil is currently offline  rkombiyil
Messages: 59
Registered: March 2006
Member
Dear list members,

Sorry to bother with a trivial (?) question.. I was wondering if there
is a way to convert a hex byte string to corresponding ascii string?
i.e., 'ABC ' would be coded as:41424320 (long int), I need to convert
this back as ascii..
What I did was to read in the corresponding long integer
representation and then use the "Z" format specifier to get the hex
representation and look up the "ASCII" table for the characters. But
in this case, the order in which these (ascii characters comprising
the string) appear reversed (?!, i.e., 'ABC ' as ' CBA'), which I
suspect is due to the way hex is computed from its corresponding
binary representation?

I am confused. Any suggestions / where can I find some examples to
clear up this hex muddle in my head? :-(

tia,
/rk
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Basic IDL/ENVI Input file/Apply calc/Output to new file
Next Topic: Re: significance of a linear regression

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:33:40 PDT 2025

Total time taken to generate the page: 0.00536 seconds