Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
As per my requirement i need split out integers values which I am trying to do for example
"101. Asd-dfg , 103. Cdf-dfg-a,b,c"
Output
101
103
I tried normalizing then split function
This one case is not able to handle
Any suggestions would be appreciated
Hi
Create a function in a custom routine to use regex to extract the integer value, eg:
package routines;
import java.util.regex.*;
public class MyRoutine {
static Pattern pattern=Pattern.compile("\\d+");
static Matcher matcher=null;
static String result="";
public static String findIntegerValue(String inputData) {
matcher=pattern.matcher(inputData);
while (matcher.find()) {
if (result.equals("")){
result=matcher.group();
}else{
result=result+","+matcher.group();
}
}
return result;
}
}
This function return a string result like "101,103", then you can use tNormalize to split the row to multiple rows.
Please try and let me know if you have any questions.
Regards
Shong