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

Home » Public Forums » archive » Re: Vectorized STRMID ( was Re: Selecting odd/even numbered files)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Vectorized STRMID ( was Re: Selecting odd/even numbered files) [message #30052] Wed, 03 April 2002 15:38
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
David Fanning wrote

> You wouldn't be up for writing a string processing tutorial
> (a la JD's Dimensional Juggling tutorial) would you, Wayne?
> I can't be the only one who gets totally confused every time
> I have to do something like this.

I'll put it on the "to do"list -- so maybe it will be done in a couple of months...

Meanwhile, here's a one line solution to the orignal problem (of selecting only
even numbered files), by specifying that the last character must be an even number

files = file_search('*[02468].ext')

The above works in V5.5 (when file_search() was introduced as a replacement for
findfile()) . For Unix systems and any version of IDL one can also write

files = findfile('*[02468].ext')

but, unlike the file_search() method,I don't believe that this method works for
non-Unix systems.

Cheers, --Wayne landsman@mpb.gsfc.nasa.gov
Re: Vectorized STRMID ( was Re: Selecting odd/even numbered files) [message #30054 is a reply to message #30052] Wed, 03 April 2002 13:24 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Wayne Landsman (landsman@mpb.gsfc.nasa.gov) writes:

> The reason you were getting 4x4 output arrays is that the vectorized STRMID is
> sometimes *too* powerful -- it can both extract many substrings from a single
> string, and extract substrings from many strings. Therefore, the position
> parameter has to be REFORMed into a 2-d array.

Well, there you go. :-)

You wouldn't be up for writing a string processing tutorial
(a la JD's Dimensional Juggling tutorial) would you, Wayne?
I can't be the only one who gets totally confused every time
I have to do something like this.

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: testcase
Next Topic: sec : U Re: analyze reader and writer in IDL?

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

Current Time: Wed Oct 08 07:09:24 PDT 2025

Total time taken to generate the page: 0.00453 seconds