on 11-29-2007 3:23 AM
Hello All,
I need to create a UDF to split the contents of my input values.
InputValue = abcdefghijklmnopqr
Expected Output = cdefghklm
I need the output should be like this cdefghklm. Can you give me the code for this Java function to build.
Thanks,
Jane.
This code is for splitting at a particular character in this example a "-".
input to the UDF is a string called a.
int ind = a.indexOf("-");
if (ind>=0){
ind++;
return a.substring(ind,a.length());
}
else{
return a;
}
Regards,
Ravi Kanth Talagana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Input1 ---> SubString function of (2,5) ---Concat1 --|
>Concat2 - > Output Input1 ---> SubString function of (5,8) ---Concat1 -- |
Input1 ---> SubString function of (10,18) - |
This how the mapping file will be.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi jane,
If the length of the inputValue is fixed, then you can use inputvalue.substring() function.
The procedure is simple
first obtain the substring (2,7)
then obtain the substring (10,12)
Then <b>concat </b>these to strings you will obtain your Expected Output.
regards
Ramesh P
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jane,
What is the mapping rule.i mean how do you want to split input value? is it based on text or index?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.