on 09-03-2010 11:13 AM
Hi ,
I am getting as a,b,c as element tag I need to split and pass a b and c to the receiver element tag
<Element>a,b,c</Element>
I need to get the output like the below
<Element>a</Element>
<Element>b</Element>
<Element>c</Element>
Please suggest me how to do this
Thanks
Prasad
Hi Prasad,
First on the receiver structure, rightclick on the field 'Element' & duplicate it 2 more times.
Once this is done, on the first receiver 'Element', use the mapping as:
Source Element ---> Substring1 --> Receiver Element1
Then,
Source Element ---> Substring2 --> Receiver Element2
Source Element ---> Substring3 --> Receiver Element3
The values for Substring 1, 2 & 3 will depend upon the Source element value.
-Supriya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Input will be : Var1 type string
Execution type: All values of a queue.
String delimiter ="," ;
String[] temp = var1[0].split(delimiter);
for(int i=0;i<temp.length;i++)
{
result.addValue(temp i );("i" is under square brackets)
}
Thanks
Amit
Edited by: AmitSri on Sep 3, 2010 12:40 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create a UDF with 2 input parameters as "instr" & "delimiter" and pass the constant "comma" to the delimiter & Element to instr input parameters.
String[] outstr = instr[0].split(delimiter[0]);
for (int i = 0; i < outstr.length; i++)
result.addValue(outstr<i>);
Just make sure the target "Element" has 0..Unbounded occurrance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you will create the UDF then you have to define "instr" & "delimeter" as an argument. Default values will be 'a' or 'var1'.
Secondly do not copy and poste the code directly from SDN becasue it carries some hidden footprints which creates some strange problems. So copy the code from here then first paste it on notepad and then you can copy it again from your notepad to use it.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.