Re: strsplit bug [message #37694] |
Fri, 16 January 2004 08:04 |
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  |
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  |
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  |
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
|
|
|