How to Send a Value from source to Target as 3 split value
I need a help.
My requirement is I have a filed name "Comments" in source system and this comment filed i needs to pass to the target in 3 fields.The comment value will be separated in 3 fields like 1)Details 1, 2)Details 2,and 3) Details,as a 40 character. so how can i get this output Kindly help me.Thanks in advanced.
Harish Mistri replied
you can use the below UDF.
input - input string
number - how many no of char (in your case it is 40)
pos - which position you want (1 for first 40, 2 for 2nd..)
int num = Integer.parseInt(number);
int posi = Integer.parseInt(pos);
String res = "";
res = (input.substring(num*(posi-1), num*posi));
res = (input.substring(num*(posi-1)));