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

Home » Public Forums » archive » Re: strsplit bug
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: strsplit bug [message #37694] Fri, 16 January 2004 08:04
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Wayne Rigby wrote:
> Reimar Bauer <R.Bauer@fz-juelich.de> wrote
>
>
>> What does happen to strsplit?
>>
>> IDL> test='Column1!CColumn2'
>> IDL> print,strsplit(test,'!C',/extr)
>> % Compiled module: STRSPLIT.
>> olumn1 olumn2
>>
>> regards
>>
>> Reimar
>
>
> Reimar,
>
> May this is what you want?
>
> IDL> print, strsplit(test, '!C', /regex, /extract)
> Column1 Column2
>
> Without the regular expression keyword, I believe strsplit
> is splitting on either '!' or 'C'.
>
> --Wayne


Yes

Thanks


Reimar
Re: strsplit bug [message #37710 is a reply to message #37694] Thu, 15 January 2004 07:14 Go to previous message
rigby is currently offline  rigby
Messages: 16
Registered: September 1995
Junior Member
Reimar Bauer <R.Bauer@fz-juelich.de> wrote

> What does happen to strsplit?
>
> IDL> test='Column1!CColumn2'
> IDL> print,strsplit(test,'!C',/extr)
> % Compiled module: STRSPLIT.
> olumn1 olumn2
>
> regards
>
> Reimar

Reimar,

May this is what you want?

IDL> print, strsplit(test, '!C', /regex, /extract)
Column1 Column2

Without the regular expression keyword, I believe strsplit
is splitting on either '!' or 'C'.

--Wayne
Re: strsplit bug [message #37712 is a reply to message #37710] Thu, 15 January 2004 06:53 Go to previous message
rs131313 is currently offline  rs131313
Messages: 1
Registered: January 2004
Junior Member
The problem is that the pattern looks for either ! or C. Just add the
/REGEX keyword and it will only look for the whole pattern.

print,strsplit(test,'!C',/extr,/regex)

This should do the trick.

Rich


Reimar Bauer <R.Bauer@fz-juelich.de> wrote in message news:<bu5kk6$3lu2$1@zam602.zam.kfa-juelich.de>...
> Reimar Bauer wrote:
>> Dear all
>>
>> What does happen to strsplit?
>>
>>
>> IDL> test='Column1!CColumn2'
>> IDL> print,strsplit(test,'!C',/extr)
>> % Compiled module: STRSPLIT.
>> olumn1 olumn2
>>
>> regards
>>
>> Reimar
>
>
> The example 3 of the documentation shows two separtion characters.
>
>
> IDL> str = 'red&&blue&&yellow&&odds&ends'
> IDL> PRINT, STRSPLIT(str, '&&' ,/EXTRACT)
>
>
> Reimar
Re: strsplit bug [message #37716 is a reply to message #37712] Thu, 15 January 2004 00:56 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Reimar Bauer wrote:
> Dear all
>
> What does happen to strsplit?
>
>
> IDL> test='Column1!CColumn2'
> IDL> print,strsplit(test,'!C',/extr)
> % Compiled module: STRSPLIT.
> olumn1 olumn2
>
> regards
>
> Reimar


The example 3 of the documentation shows two separtion characters.


IDL> str = 'red&&blue&&yellow&&odds&ends'
IDL> PRINT, STRSPLIT(str, '&&' ,/EXTRACT)


Reimar
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: determining size of window
Next Topic: phase unwrappping

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

Current Time: Sat Oct 11 05:55:00 PDT 2025

Total time taken to generate the page: 0.48190 seconds