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

Home » Public Forums » archive » Unexpected negative values when reading txt file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Unexpected negative values when reading txt file [message #86649] Mon, 25 November 2013 23:55 Go to previous message
Oliver Angelil is currently offline  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
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: GDL 0.9.4 delivered
Next Topic: save problems

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

Current Time: Wed Oct 08 18:24:06 PDT 2025

Total time taken to generate the page: 0.00198 seconds