Skip to Content
0

Message Mapping : Increments

Aug 18, 2017 at 05:21 PM

75

avatar image
Former Member

Hi Experts,

I have a requirement to add a alphabet for every next filed I same queue.
like if source exist concat Target field1 with A then Target 2 with B.

Is this can be achieved by Graphical mapping or should I have to write UDF.

Thanks in advance.

Regards,

Pooja

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Raghuraman S Aug 21, 2017 at 09:00 AM
0

Check if the below UDF(all Values of Queue) helps

int leng = var1.length;
String[] a = new String [] {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
for(int i=0;i<leng;i++)
{
result.addValue(var1[i]+a[i]);
}



capture.png (31.6 kB)
capture1.png (20.6 kB)
capture2.png (33.2 kB)
Show 3 Share
10 |10000 characters needed characters left characters exceeded

You may consider slightly modifying the code to start back again with "A" after 26 iteration or else it will fail with OutOfBoundException.

0

Yep.If this the requirement will change it.

0

The below code will start iterating from 'A' once again once the26 alphabets are completed.

char[] alpha = new char[var1.length];
int k = 0;
for(int i = 0; i < var1.length; i++){
alpha[i] = (char)(65 + (k++));
if(k==26)
{
k=0;
}
result.addValue(var1[i]+alpha[i]);
}

0
Anurag Tyagi Aug 19, 2017 at 08:13 PM
0

please explain your requirement more clearly.

Share
10 |10000 characters needed characters left characters exceeded