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

Home » Public Forums » archive » Reading data, from a file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Reading data, from a file [message #79931] Fri, 13 April 2012 04:05
shambhu is currently offline  shambhu
Messages: 41
Registered: December 2011
Member
Hi,

Please check the following code. I want to print the data from the
first line, but when i assign t=dummy(0) it taking 5th value from the
dummy. So please help me on this.

dummy = strarr(5)

openr,lun,'cdays.dat.old',/get_lun

for j=0, 2 do begin
readf,lun,dummy
;readf, lun ,dummy(0)
t=dummy(0) & print,'T val is', t
print,dummy
endfor

free_lun,lun

Output:
IDL> test123
T val is time (Jul day), Sol Flux (W/m^2), MLD (m), h (m/s), hplus (m/
s)
time (Jul day), Sol Flux (W/m^2), MLD (m), h (m/s), hplus (m/s)
289.02084 1.735E+02 1.226E+01 5.553E-06 5.553E-06
289.04169 1.735E+02 1.227E+01 5.552E-06 5.552E-06
289.06253 1.735E+02 1.228E+01 0.000E+00 0.000E+00
289.08337 1.735E+02 1.228E+01 5.553E-06 5.553E-06
T val is 289.10422 1.735E+02 1.229E+01 5.553E-06 5.553E-06
289.10422 1.735E+02 1.229E+01 5.553E-06 5.553E-06
289.12506 1.735E+02 1.230E+01 0.000E+00 0.000E+00
289.14590 1.735E+02 1.230E+01 5.553E-06 5.553E-06
289.16675 1.735E+02 1.231E+01 5.552E-06 5.552E-06
289.18759 1.735E+02 1.232E+01 0.000E+00 0.000E+00
T val is 289.20844 1.735E+02 1.232E+01 5.553E-06 5.553E-06
289.20844 1.735E+02 1.232E+01 5.553E-06 5.553E-06
289.22928 1.735E+02 1.233E+01 5.553E-06 5.553E-06
289.25012 1.735E+02 1.234E+01 5.553E-06 5.553E-06
289.27097 1.735E+02 1.235E+01 0.000E+00 0.000E+00
289.29181 1.735E+02 1.235E+01 5.552E-06 5.552E-06
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Reverse engineering the new graphics PLOT() margin property?
Next Topic: Re: Reading data, from a file

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

Current Time: Wed Oct 08 15:22:54 PDT 2025

Total time taken to generate the page: 0.00497 seconds