cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping

Former Member
0 Kudos

Hi All

I have two source fields,first one is from 0-11 char and second one is from 12-22 char,I need to concatenate both and send to target.But the source 1st field can have any number of char upto 11 char.

For eg I pass 17 in the first field and 100 in the 2nd field I need to get 17( 9 spaces)100 in my target field.

For eg I pass 2 in the first field and 6 in the 2nd field I need to get 2( 9 spaces)6 in my target field.

How can I achive this

thanks

points will be awarded

Edited by: guest xi on Feb 28, 2008 11:01 PM

Accepted Solutions (1)

Accepted Solutions (1)

justin_santhanam
Active Contributor
0 Kudos

Hi,

Write simple UDF with two input parameters a,b.



StringBuffer sb = new StringBuffer("");
for(int i=a.length();i<12;i++)
{
sb.append(" ");
}
return a+""+sb.toString()+""+b;

raj.

Former Member
0 Kudos

Thanks raj,problem solved.Appreciate your help

Points awarded

justin_santhanam
Active Contributor
0 Kudos

No Problem

raj.

Answers (1)

Answers (1)

Former Member
0 Kudos

In the mapping convert the numbers to strings and then concatenate. I guess you will achieve your target