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

Home » Public Forums » archive » Re: readcol problems
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
Re: readcol problems [message #49492] Wed, 02 August 2006 07:38
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Amanda,
hm, not sure where you found readcol, but it's not part of the IDL
distribution. If you insist on using it, you need to contact the
original author to supply the numlines function to you. Otherwise it's
pretty simple to construct your won reader. E.g.:

pro readfile,fname,data
ndat=file_lines(fname)
data_struct={x:0.0,y:0.0}
data=replicate(data_struct,ndat)
openr,runit,fname,/get_lun
readf,runit,data
close,runit
free_lun,runit
return
end

Then do
plot,data.x,data.y

Cheers,
Haje



Amanda wrote:
> I'm pretty new to IDL and don't know much about it.
>
> I'm trying to use the readcol function but I keep getting errors
> "variable
> is undefined", "attempt to call undefined procedure/function:
> 'NUMLINES'"
> and sometimes it can't seem to find my .dat file. I'm guessing I must
> be
> missing some horribly obvious line to get the "variable undefined"
> error
> but I don't know why I keep getting the Numlines error. I don't need it
> to count the number of lines, I just want to plot x against y.
>
> I'm using a windows version and this is the code I'm using:
>
> PRO test, x, y
>
> readcol, 'test.dat', x, y, f='f,f,'
>
> plot, x, y, psym=2
>
> END
>
> Any help would be greatly appreciated. :)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: correlation of images
Next Topic: Re: can't change PATH preference under Windows?

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

Current Time: Thu Oct 09 22:31:57 PDT 2025

Total time taken to generate the page: 1.35799 seconds