07-16-2013 09:16 PM
G'day,
I'm writing a process that takes as input a multiline string. I need to chop this string up via newlines and iterate through each one but I can't work out how to split a string based on newlines and the TEO Reference Guide is suitably vague on what special characters (if any) one can split a string on .
This process is intended to be initiated directly via TEOWebConsole at this stage else I would implement this in CCP instead.
Thoughts?
Solved! Go to Solution.
07-17-2013 03:37 AM
You can use the regex ^.*$
and then feed in the string and then loop through it, trim off the ends and go from there.
I have a TAP of some commonly used functions that I use in many of my automations. I call it the Automation Function Tools. I have uploaded the zipped tap to here. Download it, unzip, and import.
It has a function called convert multi-line to single-line string. While that might not be exactly what you are doing, you can pull the pieces out for the breaking at newline and be ok I think.
Here's a screenshot of what I mean:
--shaun
07-17-2013 03:37 AM
You can use the regex ^.*$
and then feed in the string and then loop through it, trim off the ends and go from there.
I have a TAP of some commonly used functions that I use in many of my automations. I call it the Automation Function Tools. I have uploaded the zipped tap to here. Download it, unzip, and import.
It has a function called convert multi-line to single-line string. While that might not be exactly what you are doing, you can pull the pieces out for the breaking at newline and be ok I think.
Here's a screenshot of what I mean:
--shaun
07-17-2013 03:40 PM
Chris,
Thats excellent news. I was hoping the split string could understand special characters like tab and newline but a regex works fine for me. I even tried passing the string to a powershell script but of course multiline strings aren't supported with powershell!
I'm guessing if I rename the extension to your attachement as .tap then I should be able to import that directly?
Otherwise, my is ryan.ruckley@alphawest.com.au
Thanks.
Ryan
07-17-2013 04:07 PM
Ryan,
It's a TAP file inside of a zip. Show extract the TAP from the zip using your favorite .zip extracter then you should be able to import.
--shaun
07-17-2013 04:33 PM
Chris,
Cheers got it.
Ryan
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide