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

Home » Public Forums » archive » readcol procedure
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: readcol procedure [message #32080 is a reply to message #32020] Wed, 11 September 2002 07:54 Go to previous messageGo to previous message
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
Reimar Bauer wrote:

> this routine is platform dependent because it uses a unix shell command.
> I like unix but it's not a problem for idl to determine this itselfs.

numlines.pro (http://idlastro.gsfc.nasa.gov/ftp/pro/misc/numlines.pro called by readcol.pro) only
spawns to the Unix 'wc' command if !VERSION.OS equals 'unix' (for speed). Otherwise it counts the
number of lines.

> Perhaps you can try the routine file_line I have defined in 1996 and
> which was improved later by Paul Krummel. You can find this routine by
> David at http://www.dfanning.com/tip_examples/file_line.pro

Hmm, I would have thought that reading the entire file into a byte array simply to count the number
of lines would be overkill. But in my quick tests, file_line.pro does seem to be faster than
counting the number of lines, and almost as fast (on Unix) as spawning to 'wc'.

I have heard a rumor that there may be a standardized way of counting the number of lines in a file
in the next release of IDL ;-)

--Wayne
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: duplicate .pro filenames
Next Topic: Re: duplicate .pro filenames

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

Current Time: Wed Oct 08 11:42:33 PDT 2025

Total time taken to generate the page: 0.00546 seconds