Re: Writing an 8 Column array into a data file [message #87575 is a reply to message #87571] |
Sat, 15 February 2014 09:59   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
drewciampa@gmail.com writes:
> Also, maybe you guys could still help with whats going on with the hexadecimal data. That array contains string type variable, and when I write it to a file I only get the first number of each element. some sample code is below:
>
> array1 STRING = Array[1, 5]
>
> the array contains:
> [2b40e2200ff00007, 2b40e2200ff00009, 2b40e2200ff0000c, 2b40e2200ff00011, 2b40e2200ff00019]
>
> openw, lun, 'test.dat', /get_lun
> printf, lun, array1, FORMAT='(Z16)'
> close,lun
>
> what I get is:
> 2
> 2
> 2
> 2
> 2
>
> Any clue why this might be?
Confusion on your part, I'm going to guess. :-)
What exactly are you trying to do? The array does NOT look like it
contains string variables. If it *did* contain string variables, you
could just write them out as strings. If you are trying to write the
strings out as hexadecimal numbers, then IDL has to convert them to
hexadecimals to write them. A number "b" doesn't make much sense in this
conversion process, so IDL does what I would do, gives up and goes gets
a beer. What would you do?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|