on 05-27-2015 9:50 AM
Hi Experts,
I need an udf to split the data in runtime.
Please find the example below:
Input --
1. GENERAL (General II & IV SAT OFF)
2. G3 (8.30am-5pm)
And I need the output as :
1. GENERAL
2. G3
Please help me with this. The data in the brackets is not required, I only require the data which is not in brackets.
Hi Praveen,
use below code to get substing before the opening bracket. In UDF select Execution type as All Values of a context.
public void split(String[] input, ResultList result, Container container)throws StreamTransformationException{
int beginIndex = 0;
int endIndex = 0;
for(int i=0; i<input.length; i++){
endIndex = input[i].indexOf("(");
result.addValue(input[i].substring(beginIndex, endIndex));
}
}
Regards,
Santhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen ,
If I understand your question properly, then can we not use "SubString" function under Text function in ESR itself, than using UDF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.