on 05-22-2013 4:35 AM
Hi All,
my requirement is source field value is 12345_00010.
my expected out put is 00010.
after underscore i need to get the output.
plz send me udf for this requirement.
Thanks,
Aadi
Hi,
check below java code for splitting.
http://www.roseindia.net/tutorial/java/core/splitmethod.html
do the splitting and return the second array string.that would be your final output.
you can refer below for creating UDF.
Regards,
Muniyappan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,,
try this.
public String Test(String var1, Container container) throws StreamTransformationException{
String str = "_";
int len=var1.length();
int i =var1.indexOf(str);
str= var1.substring(i+1,len);
return str;
}
Regards,
Loordh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try the below code in your UDF :
{ int n = var1.indexOf("_");
String result = var1.substring((n+1));
return result;
}
where var1 takes input from the incoming source field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
>>>plz send me udf for this requirement.
why don't you just put - split java in google and do the UDF yourself ? it's a good exercise
Regards,
Michal Krawczyk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.