on 11-27-2012 7:42 AM
Hi Everyone,
I want some help with mapping requirement,
the easiest way to explain the requirement to provide examples. The simple explanation is to extract everything except the last five characters from source feild and map to target feild. See below.
if the source feild = 7TW7003-USP1, THEN i only want 7TW7003
if the feild = 7TW7005-USP1, THEN MAP 7TW7005
If the feild = S5079826-1-USP1, THEN MAP S5079826-1
Please help me with the above requirement.
Regards
Swetha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi swetha,
At first you could calculate the length of string with the function length, next you substract four to that value and finally use this UDF:
public String dynamicSubstring(int begin, int end,String c,Container container){
return (c.substring(begin,end));
}
Also you could do all in one UDF, but if you do a generic UDF you can reuse it in other map.
Regards.
Message was edited by: Iñaki Vila
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.