cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Logic for UDF

Former Member
0 Kudos

Hello All,

I need to create mapping to split an input string into a predefined length (say 10 characters). However I also have to ensure that no word is split in between.

<Input>

<Input_text>This is a statement with variable length</Input_text>

</Input>

<Output>

<Node>

<Output_String>This is a </Output_String>

</Node>

<Node>

<Output_String>statement </Output_String>

</Node>

<Node>

<Output_String>with </Output_String>

</Node>

<Node>

<Output_String>variable </Output_String>

</Node>

<Node>

<Output_String>length</Output_String>

</Node>

</Output>

Any idea how to proceed?

<Moved from Process Orchestration Space>

Message was edited by: Prateek Raj Srivastava

Accepted Solutions (0)

Answers (1)

Answers (1)

gagandeep_batra
Active Contributor
0 Kudos

Hi Pankaj

Flowwing logic might help you.

i=0;

while(i<=strglength)

{

if(a[i+10] = ' ')

     {

     str.split(i,i+10);

     i=i+10;

        } 

else

     {

     i=i+10;

     j=10

          while(a[i] != ' ')

               {

                    i--;

                    j--;

               }

     str.split(i,j);

     }

}

Regards

Gagandeep