I am working on a WSO2 integration that needs to create a flat file - so basically, a file with only 1 column, the column is 200 some characters wide, and there is a specific protocol for what values go into which positions. For example -
- positions 1-3 = record type
- position 4 = blank space
- position 5-20 = First name
- position 21 = blank space
- positions 22-32 = Last name
etc etc.
So in that example, the last name is given 10 "digits," which means that if the person's last name is Smith, I need to pad the property with 5 subsequent extra spaces - so like 'Smith(followed by 5 spaces)'. I've found simple solutions for this using substring(concat('$ctx:LastName', ' '), 1, 10)
. Which seems to work just fine for smaller sizes of padded placeholders. However, the issue I'm running into is that some of the fields I'm padding need to have over 100 characters. And I REALLY don't want to count 100 spaces in between my single quotes there. Are there any elegant solutions to dealing with this type of thing in WSO2?
Thank you.