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

Home » Public Forums » archive » Re: How do I convert an array of hexadecimal numbers to integers?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How do I convert an array of hexadecimal numbers to integers? [message #12951] Tue, 22 September 1998 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Robert Lematta (lematta@yahoo.com) writes:

> Does anyone out there have an simple idl routine to convert an array of
> hex numbers to an equal sized array of the equivlent integer numbers?
> For example the 4 by 6 array below. I have some huge hex datafiles that
> I am trying to plot and the only way I have found so far is to brute
> force the arrays.
>
> 79 86 A0 A0 A5 AB
> AB A3 A3 A6 A1 A6
> A3 9F A3 A9 AD AA
> A6 A7 A8 AD B7 AF

I'm not sure exactly what you mean by "an array of hex numbers".
If I put your little example data in a file, I read it like
this:

OpenR, lun, 'hex.dat', /Get_Lun
array = IntArr(6,4)
ReadF, lun, array, Format='(6(z2, x))'

Done. :-)

Cheers,

David

----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Previous Topic: DBTOOLKIT
Next Topic: How do I convert an array of hexadecimal numbers to integers?

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

Current Time: Sat Oct 11 12:31:23 PDT 2025

Total time taken to generate the page: 0.00331 seconds