There are two fields in the file layout,
Address Field 1 (position 71-100)
Address Field 2 (106-140)
We need to have the value in address field 1 be less than 30 characters. If it goes over 30 characters then it needs to start in Address field 1 and then continue on in Address field 2. They do not want the words to truncate either so for example if the word ‘Box’ is at position 100 they want the entire word moved to start at position 106 not just the ‘ox’
Example:
On the xml the Address is: 9999 Old main high street rd Box 200
In Address Field 1 (position 71-100) we need to see: 9999 Old main high street rd
Then have Filler records from (position 101-105)
Then In Address Field 2 (106-140) we need to see: Box 200
Please suggest how to achieve this. I tried the below but it is not working,
I used indexof transforer to look for the space and created loop and keep on doing the indexof but now the starting position is of the previous space position which is found. Then used Tokenize with the space as the delimiter to make a valuelist array and looped on that array to built a string. When the string length is > 30 is it will map the result to Address 2. This is where I am struggling. Please advise.