Unexpected negative values when reading txt file [message #86649] |
Mon, 25 November 2013 23:55  |
Oliver Angelil
Messages: 11 Registered: November 2013
|
Junior Member |
|
|
Hi,
I'm opening and reading from a txt file. The first line is:
AIG 560401 130713 6.924435968 46.32664277
I'm having trouble reading the integers 560401 and 130713. I cannot read all six digits (four seems to be the maximum). My code is:
-----------------------------------------------
OPENR, lun, filename, /get_lun
sdata=string(0)
idata = intarr(2)
readf, lun, sdata,idata, format= '(A3, 2I5)'
------------------------------------------------
This produces:
IDL> print, sdata
AIG
IDL> print, idata
5604 1
As soon as I change format='(A3, 215)' to format ='(A3,2I7)'
It produces random negative values!?
IDL> print, idata
-29423 -359
Thanks in advance,
Oliver
|
|
|
|
|