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 #49356 is a reply to message #49354] Wed, 19 July 2006 12:04 Go to previous messageGo to previous message
ChristopherFlorio is currently offline  ChristopherFlorio
Messages: 23
Registered: April 2006
Junior Member
Actually now I am having a new problem. I want to put text on the other
side of the asterisk.

file='ImageEarth2.img'
filter='Image*.img'

file=STRJOIN(STRSPLIT(file,filter,/EXTRACT,/REGEX))
file='ImageEarth2.img'

with file=STRJOIN(STRSPLIT(file,filter,/EXTRACT))
file='Erth2'

Any Suggestions?

JD Smith wrote:
> 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: Sat Oct 11 04:22:56 PDT 2025

Total time taken to generate the page: 0.79961 seconds