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

Home » Public Forums » archive » Determining length of a text 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
Re: Determining length of a text file? [message #40964 is a reply to message #40889] Mon, 20 September 2004 15:14 Go to previous message
kklare is currently offline  kklare
Messages: 7
Registered: April 2004
Junior Member
lingfeng.wen@gmail.com (Robin Wen) wrote in message news:<9cac9f11.0409161530.5e083dae@posting.google.com>...
> pestMay@gmail.com wrote in message news:<U1P0d.18575$H83.10215@newssvr27.news.prodigy.com>...
>> In IDL v6.1:
>>
>> n_lines = File_lines(filename)
>>
>> does what you need.
>>
>> Ed May
>
> In regard of the old verion of IDL, you can try the 'readf' with loop
> until EOF so that you can obtain the exact the line number.
>
> Robin
It is usually more time efficient to allocate a big text array, read,
ignore the error, and truncate the empty text strings thus avoiding a
FOR loop. Since all null strings point to the same (null) memory (I
think) you only use a small temporary memory. For large table this can
improve speed a lot.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Irregular Grid in IDL
Next Topic: Re: xinteranimate and string

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

Current Time: Fri Oct 10 20:01:35 PDT 2025

Total time taken to generate the page: 0.64067 seconds