on 12-05-2008 4:55 AM
hi
i have a source structure having a field P_NAME and target structure having two filed ie F_NAME and L_NAME.
My requiremet is in i want to split the data that comes to P_NAME into the respective target filed.
for example: P_NAME = John Smith
now in
F_NAME = Jhon
L_NAME = Smith
with the code below i am able to populate F_NAME = John
but i am not able to do the same for L_SMITH.
int i = 0;
String temp = a[0].toString();
i = temp.indexOf(';');
result.addValue(temp.substring(0,i));
Regards
Kasturika
Hi,
Try like this,
int i = 0;
String temp = a[0].toString();
i = temp.indexOf(' ');
result.addValue(temp.substring(0,i));
and for second field
int i = 0;
String temp = a[0].toString();
int l = temp.length();
i = temp.indexOf(' ');
result.addValue(temp.substring(i,l-1));
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you created two such UDFs? For each target node you can create a UDF.
i = temp.indexOf(';');
As per you requirement you should take index of space.
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.