on 03-06-2013 1:30 PM
Hi All,
I requires one simple udf, i have 1 field called msg contains the below format.The delimiter is comma.But the value has no fixed format
msg - 0001221324,2000000010.
it may be like this 1221324,2000000010 also.
Can anyone suggest udf for this, i want to split this msg and map to 2 fields to vendor no and PO NO.
from starting from beginning, can anyone explain the flow to create the udf.
PFA file for my mapping.
Thanks,
dhanush
Hi,
Creat a UDF with two inputs, var1 & var 2. As you have 2 fields separated by comma, for getting 0001221324 from 0001221324,2000000010 give constant 0 as second input & the source field as first input. Similarly for getting 2000000010 from 0001221324,2000000010, give constant 1 as second input and the source as first input.
String[] result = var1.split(",");
int length = 0;
if(result != null) {
length = result.length;
}
if(var2 < length){
return result[var2];}
else {
return "";
}
the splitted strings will be passed as per the no.given in the input. Suppose a string is adarsh,dhingra,kolkata; based on int input 0, adarsh will be passed;1 will give dhingra & 2 will give kolkata.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
>>>I requires one simple udf, i have 1 field called msg contains the below format.
if it's that simple why ask for it on the forum and not just do it ?
idea:
String string = "0001221324,2000000010.";
String[] parts = string.split("-");
String part1 = parts[0]; // 0001221324
String part2 = parts[1]; // 2000000010.
Regards,
Michal Krawczyk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
I need a help from u, We got 1 reqt which is same as of blog posted previously.
I had referred ur blog, but still i need some clarification from ur side.I want to take the Exchange rate from a website and to update the SAP system.
Using wget and file adapter, u had explained, It would be great if u explain in brief.
I had taken only the RSS feeds xml file from a website.
Regards,
Dhanush
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.