Re: counting rows [message #53342] |
Mon, 09 April 2007 12:12 |
Christopher Thom
Messages: 66 Registered: October 2006
|
Member |
|
|
Quoth David Fanning:
> shishir.czt@gmail.com writes:
>
>> i am fasing problem in reading a file . the file is a text file . i
>> know the number of columns ,but wana compute the number of rows ,
>> currently i am using EOF function to do that in a loop but some how it
>> is not working .
>> tell me what can i do to make it working.
>
> Use FILE_LINES to determine the number of rows in the file.
Since you know the number of columns, you could also use "readcol.pro" in
the idlastro library, to read your data. It will read up to 25 columns of
data of a specified data type.
http://idlastro.gsfc.nasa.gov/ftp/pro/misc/readcol.pro
cheers
chris
|
|
|
Re: counting rows [message #53348 is a reply to message #53342] |
Mon, 09 April 2007 06:45  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
shishir.czt@gmail.com writes:
> i am fasing problem in reading a file . the file is a text file . i
> know the number of columns ,but wana compute the number of rows ,
> currently i am using EOF function to do that in a loop but some how it
> is not working .
> tell me what can i do to make it working.
Use FILE_LINES to determine the number of rows in the file.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|