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

Home » Public Forums » archive » IDL Array with mixed formating
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
IDL Array with mixed formating [message #91752] Thu, 20 August 2015 11:10 Go to previous message
lucesmm is currently offline  lucesmm
Messages: 26
Registered: October 2014
Junior Member
Hello All
I have a.txt that I am trying to read, and put into an array but it has mixed formats within the data (floats, and integers)

example of the line:

243.828293 133.196523 19.764000 0.030571 2 0.046510 7 0.149040 14 0.214297 12

This is how I am trying now to read it, but it doesn't work

OPENR, lun, file_name, /GET_LUN
nlines = FILE_LINES(file_name)
data=fltarr(11, nlines, /NOZERO)
line=[]

while not EOF(file_name) do begin & $
READF,lun, line, FORMAT='( 3(F+10.6, X), $( F+8.6, 1X, I3))'
data=[[data],[line]]
endwhile


Any suggestions ?

thanks
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Passing Arrays BY REFERENCE
Next Topic: Plot and Legend problem

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

Current Time: Wed Oct 08 11:31:50 PDT 2025

Total time taken to generate the page: 0.00456 seconds