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

Home » Public Forums » archive » Skip line in reading a 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
Skip line in reading a file [message #71018] Tue, 25 May 2010 23:54 Go to previous message
Fred[1] is currently offline  Fred[1]
Messages: 4
Registered: April 2010
Junior Member
Hi to everybody,
I need to read a file of n columns "namefile", but also I need to
select only the lines where the variable in column 3, i.e. [2,*], for
example, has value larger than X.
I tried this way:

n1=numlines(namefile)

OPENR, 1, namefile
aaa=fltarr(col,n1)
readf,1,aaa
close,1

aa = REFORM(aaa[2,*])
if aa[2,*] gt X then a[*,*] = aaa[*,*]

The array a should be an array a[col,n2], where n2 is the number of
the lines where aa[2,*] gt X.
But
help,/st,a
gives an array with columns=col and lines=n1!!!
So it completes the routine without errors but does not select the
lines where aa[2,*] gt X.
I could not use Skipline of readcol, because it skips only the first
line. There should be an easy way to do it.
Thanks
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Integrator taking vectors as input?
Next Topic: rotate tickname and titles

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

Current Time: Sat Oct 11 03:38:36 PDT 2025

Total time taken to generate the page: 0.87892 seconds