cancel
Showing results for 
Search instead for 
Did you mean: 

mapping requirement

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Muniyappan
Active Contributor
0 Kudos

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.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/be05e290-0201-0010-e997-b6e55f954...

Regards,

Muniyappan.

allamudi_loordh
Active Participant
0 Kudos

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

Former Member
0 Kudos

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.

MichalKrawczyk
Active Contributor
0 Kudos

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