[kepler-users] string splitter

Madhusudan Gujral madhu at sdsc.edu
Thu Jun 10 13:32:44 PDT 2010


Hi Corinna,

  What you are observing with String splitter in Kepler is the behavior of split function in java. I just wrote a couple of lines of standalone code using the same string you provided and I observed the exactly same results. Here is he example from split function javadoc

     The string "boo:and:foo", for example, yields the following results with these expressions:

        Regex 	Result
        : 	{ "boo", "and", "foo" }
        o 	{ "b", "", ":and:f" }

The second situation is one that applies to the current case. Last and perhaps first 'No Space' is eliminated; apparently that is the part of string function design. 

--Madhu
________________________________________
From: Corinna Gries [cgries at wisc.edu]
Sent: Thursday, June 10, 2010 1:05 PM
To: Madhusudan Gujral
Subject: Re: [kepler-users] string splitter

does this work, or should I zip it up?

Corinna

Madhusudan Gujral wrote:
> Hi Corinna,
>
>   My mail client blocks all the xml attachments.  Is it possible to rename it send it again?
>
>  Thanks
> --Madhu
> ________________________________________
> From: Corinna Gries [cgries at wisc.edu]
> Sent: Thursday, June 10, 2010 12:20 PM
> To: Madhusudan Gujral
> Cc: Kepler User
> Subject: Re: [kepler-users] string splitter
>
> Hi Madhu,
>
> when I run the attached workflow the output is this:
>
> {"6/19/2009", "CEW", "", "6/10/2009", "6", "1", "1000", "52.5", "31",
> "1", "1", "1.017410714", "0.625589286", "1.3125"}
>
> and it is missing the empty string in position 14. I think you may have
> had a space after the last comma, which made it work just fine.
>
> Corinna
>
> Madhusudan Gujral wrote:
>
>> Hi Corinna,
>>
>> I passed the splitter results to dsplay actor. What I observe if following
>> {"6/19/2009", "CEW", "", "6/10/2009", "6", "1", "1000", "52.5", "31", "1", "1", "1.017410714", "0.625589286", "1.3125", "", " "}
>>
>> It has elements 14 'No Space' and 15 'Space' displayed correctly. When I used Array Element actor to display the values for element 14, 15, it does not complain, but there is nothing to show.
>>
>> My guess is that the problem is related to post processing (processing the empty tokens).
>>
>> Thanks
>> --Madhu
>>
>> ________________________________________
>> From: kepler-users-bounces at kepler-project.org [kepler-users-bounces at kepler-project.org] On Behalf Of Corinna Gries [cgries at wisc.edu]
>> Sent: Thursday, June 10, 2010 11:31 AM
>> To: Kepler User
>> Subject: [kepler-users] string splitter
>>
>> Hi again,
>>
>> when I am running this line of data:
>> 6/19/2009,CEW,,6/10/2009,6,1,1000,52.5,31,1,1,1.017410714,0.625589286,1.3125,,
>>
>> through the string splitter, splitting it on ',' it omits the last empty
>> string, i.e. does not pass an empty string. Trying to read the array
>> element in position 14 throws an error rather than returning an empty
>> string, which is what I had expected.
>>
>> I can work around it by just adding something to end of the line but is
>> that an otherwise meaningful behavior?
>>
>> Corinna
>> _______________________________________________
>> Kepler-users mailing list
>> Kepler-users at kepler-project.org
>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
>>
>>



More information about the Kepler-users mailing list