on 02-08-2008 8:40 AM
In message mapping, my source field length is of 7. And target field length is of 7.
Now I need to pass source field to target field with a comma after first 4 digits.
ex: if source field value is:123456,then I need to pass the value 1234,56 to target.
Which XI standard function wll help me.
Hello,
like i said before you can do it with 2 substring and 1 concat function.
if your source field is SOURCE = 123456
Put your SOURCE-Field two times in the editor and use the substring function and the concat function like this:
SOURCE --> substring(0, 4)
-
> concat(,) --> TARGET
SOURCE --> substring(4, 6)
your TARGET will look like 1234,56
If you enter the values of the substring function -> the second value is the count of characters of the substring and NOT the second index.
So in the second case you write substring(4,2) and displayed will be substring(4, 6) !
Regards
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naresh,
What you can do is use the Substring and Concat functions together in the following manner.
To your source field, put a Substring function which takes the values from position 0, characters 4
Then put the Substring function for taking the rest of the values i.e from position 4, characters 3.
Concatenate these two using the Concat function, and use the comma as ur Delimiter in the properties.
The output then goes to the target.
The point here is that your target field cannot be of length 7, because the comma is an extra char. Hence, the target field must be of length 8.
Hope the solution helps.
Regards,
Lavita.
P.S. Do reward points if the information is useful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a User defined function
String first = a.substring(0,4);
String second = a.substring(4,6);
String C = first","second;
return C;
Copy and paste this code.You ll get the required output.
Regards,
Sakthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naresh,
U can achieve this by using standard Substring,Concat & Constant function.
Fieldname -> substring(0 to 4)-\Concat------\
Constant(,)--
Fieldname----substring(4 to 6)--
/
Thanks,
Maheshwari
Edited by: Maheshwari Morbale on Feb 8, 2008 10:01 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
you could use two substring functions for the digits and one concat function with a ',' as separator.
Regards
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.