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

Home » Public Forums » archive » Re: String Spliting
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: String Spliting [message #49357 is a reply to message #49356] Wed, 19 July 2006 10:39 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Wed, 19 Jul 2006 07:49:10 -0700, ChristopherFlorio wrote:

> I am having a problem with the STRSPLIT function. I am using it to extract
> the file extension from a string where it might not be at the end.
> However in the process I am also eliminating addition elements, not found
> in the extension.
> For example
>
> file='Image.img'
> filter='*.img'
>
> file=STRJOIN(STRSPLIT(file,filter,/EXTRACT))
>
> file='Iae'
>
> desired output:
> file='Image'
>
> Is there a way, with the same input as above, not to extract individual
> parts of the name found in the filter/pattern?

Just a guess, but you'd probably be happier with:

file=file_basename(file,'.img')

(which strips any leading directory too).

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Surface plots in spherical coordinates
Next Topic: Re: mpfitexpr using functargs

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

Current Time: Fri Oct 10 13:37:09 PDT 2025

Total time taken to generate the page: 0.48361 seconds