|
Re: idl/gdl/strmatch [message #69559 is a reply to message #69548] |
Thu, 21 January 2010 09:29   |
oxfordenergyservices
Messages: 56 Registered: January 2009
|
Member |
|
|
On 21 Jan, 17:18, pp <pp.pente...@gmail.com> wrote:
> On Jan 21, 1:58 pm, a <oxfordenergyservi...@googlemail.com> wrote:
>
>> The only problem I have so far is that strmatch which I use a load of
>> times isn't in gdl. Are there any simple workarounds?
>
> GDL has stregex, which can do what strmatch does, and much more.
>
>
>
>> I need the wilcard to work ie
>
>> a=['abc','def',ghi']
>
>> b='*e*'
>
>> i=where(strmatch(a,b) eq 1)
>
>> gives i=1
>
> That particular example can be done with
>
> b='e'
> i=where(stregex(a,b,/boolean))
thanks. i may try that. i wrote a function that does it via the
commmand line, but a bit ugly
any ideas for a gdl strsplit('aaa bbbb',/extract)??
Thanks
Russ
|
|
|
Re: idl/gdl/strmatch [message #69560 is a reply to message #69559] |
Thu, 21 January 2010 09:18   |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Jan 21, 1:58 pm, a <oxfordenergyservi...@googlemail.com> wrote:
> The only problem I have so far is that strmatch which I use a load of
> times isn't in gdl. Are there any simple workarounds?
GDL has stregex, which can do what strmatch does, and much more.
>
> I need the wilcard to work ie
>
> a=['abc','def',ghi']
>
> b='*e*'
>
> i=where(strmatch(a,b) eq 1)
>
> gives i=1
That particular example can be done with
b='e'
i=where(stregex(a,b,/boolean))
|
|
|
Re: idl/gdl/strmatch [message #69652 is a reply to message #69548] |
Wed, 27 January 2010 06:11  |
oxfordenergyservices
Messages: 56 Registered: January 2009
|
Member |
|
|
On 21 Jan, 20:00, pp <pp.pente...@gmail.com> wrote:
> On Jan 21, 3:29 pm, a <oxfordenergyservi...@googlemail.com> wrote:
>
>> thanks. i may try that. i wrote a function that does it via the
>> commmand line, but a bit ugly
>
>> any ideas for agdlstrsplit('aaa bbbb',/extract)??
>
> strsplit exists inGDL. Maybe you are using an older version?
>
> Anyway, you may find this reference useful
>
> http://michaelgalloy.com/2009/12/01/routines-currently-avail able-in-g...
thanks. it didn't come with the package i downloaded straight onto
ubuntu. version 0.9 i think
|
|
|