Skip to Content
0

PI Mapping : Create extra node for text after 65 char

Jul 28, 2017 at 08:54 PM

63

avatar image
Former Member

Hi Experts,

I am working on one of the interface were I need to cut the incoming text into 65 Char and send it to target Node , If the text is more than 65 Char I need create the another node for rest of the characters in text or up to 65char again if its more than 65 char and this will repeat every 65 char in text.

And for every node I have to add sequencing starting from 1.

Target result :

Text ---->Node (65 char ) 1 aaaaaaaaaaa

Node (65 char ) 2 bbbbbbbbbbb
Node (65 char ) 3 ccccccccccccc

...............

Really appreciate if their is any UDF that will help in achieving this requirement.

Thanks in advance.

Regards,

Pooja

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

2 Answers

Raghuraman S Jul 31, 2017 at 07:48 AM
0

Use the below UDF(all values of queues),This will create and split target node for every 65 characters

String calc=var1[0];

String b[]=calc.split("(?<=\\G.{65})");

int leng = b.length;

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

{

result.addValue(b[i]);

res.addValue("");

}

Share
10 |10000 characters needed characters left characters exceeded
Harish Mistri Jul 31, 2017 at 07:38 AM
0

Hi Pooja,

You can duplicate the target node in the message mapping and put the condition on the second node creation if the source field length is greater than 65.

regards,

Harish

Share
10 |10000 characters needed characters left characters exceeded