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 #49347] Thu, 20 July 2006 06:37 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
ChristopherFlorio@gmail.com wrote:
> Michael Galloy wrote:
>> ChristopherFlorio@gmail.com wrote:
>>> 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?
>>>
>> The desired output is 'ImageEarth2'? I'm not sure what the entire line
>> looks like, but how about this?
>>
>> IDL> file = 'ImageEarth2.img'
>> IDL> s = stregex(file, '([[:alnum:]]+)\.img', /extract, /subexpr)
>> IDL> print, s[1]
>> ImageEarth2
>
> The desired output is "Earth2". I want to eliminate all 'filter'
> information from 'file'.

OK:

IDL> file='ImageEarth2.img'
IDL> s = stregex(file, 'Image([[:alnum:]]+)\.img', /extract, /subexpr)
IDL> print, s[0]
ImageEarth2.img
IDL> print, s[1]
Earth2

Mike
--
www.michaelgalloy.com
[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 10:01:23 PDT 2025

Total time taken to generate the page: 0.63894 seconds