[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: converting to array

Martin Skou Andersen (skou@fys.ku.dk) writes:

> I have some data from a file...
> example:
> file start
> 10.5 30.5 40.8 57.9 90.8
> end of file
> I would like to read these data from a file, and these should be placed
> in a array...
> But when I read the file the datas are placed in a string. How do i get
> these data converted to a array?

array = FltArr(5) ; Or, however many values you have.
OPENR, lun, 'myfile.dat', /Get_LUN
READF, lun, array



David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155