cancel
Showing results for 
Search instead for 
Did you mean: 

mapping

former_member303666
Active Participant
0 Kudos

Hi,

The mapping requirement is input value is 400

example

in put value is (before space)

400000

400

output is comes like this(after space)

400000

400

Thanks and regards,

Kesava.

Accepted Solutions (0)

Answers (4)

Answers (4)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You can use standard trim function only to remove leading and trailing spaces. That means beginning and ending white spaces. If you find spaces in the middle then you have to use UDF to remove the spaces.

Former Member
0 Kudos

output is comes like this(after space)

400000

400

approach1:

field( 400) -> trim(Text fun . group) -> udf-> target field(400 )

udf: space depends on field

String Addspace(int var1, Container container) throws StreamTransformationException{

String var2 ="";

for (int i=0; i<=var1;i++)

{var2 = var2 + " ";

}return var2;

approach2:

field( 400) -> trim(Text) -> concat + costant( space )-> target field(400 )

Edited by: bhavanisankar.solasu on Feb 23, 2012 2:09 PM

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

In put value is (before space)

400000

400

output is comes like this(after space)

400000

400

The Input and output look the same, so I'm guessing there are whitespaces before/after the input. So you can use the standard String function called trim to remove the whitespaces.

Hope this helps,

Mark

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Kesav,

Req not clear give some more info