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 #32069 is a reply to message #32020] Thu, 12 September 2002 08:43 Go to previous messageGo to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
Wayne Landsman wrote:
>
> 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 ;-)

I'm curious: Why does anyone need to count the number of lines in an
ASCII file? If it's to subsequently read the file, then the EOF function
can be used instead to tell you where the input file ends, and it
requires only one pass through the input file. There must be another
application that I don't know about. Or is it just easier to write code
that reads an ASCII file with a known number of lines?

Can anyone enlighten me?

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
[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: Thu Oct 09 23:59:59 PDT 2025

Total time taken to generate the page: 0.64232 seconds