on 2008 Sep 03 6:50 PM
we were doing Flat file to IDOC.
we were getting a field of length 12 from which we need to convert take first 10 values from left to right.
we used the sub string function till now...
functional team says...they might also send 5 digits number...so in that case...i need to take the 5 digits number along with the 5 spaces...how will i do that.
Request clarification before answering.
Can be done with UDF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You an also use If-Else-if standard function for it.
Here is the UDF code.
String s = // assign your UDF variable here....
if (s.length() ==12){
System.out.println(s.substring(0,10)); //replace System.out.println with return in real UDF
}
else if (s.length() <= 5){
String temp = " ";
System.out.println(s.concat(temp)); //replace System.out.println with return in real UDF
}
Edited by: Farooq Farooqui on Sep 4, 2008 12:38 AM
User | Count |
---|---|
68 | |
33 | |
8 | |
8 | |
7 | |
7 | |
7 | |
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.