03-22-2017 06:23 AM
I am trying to have a fixed number of lines in a string control.
Regardless of number of lines entered in the string control, it should write say 10 lines to a text file.
So it should add blanks if user enters < 10 lines and chop off if number of lines entered are > 10.
Solved! Go to Solution.
03-22-2017 06:50 AM - edited 03-22-2017 06:50 AM
Hi zenzendapuss,
in your other thread you got several suggestions to get the number of lines in your string. Don't you use any of theses methods?
I suggest:
- convert the string into an array of strings using SpreadsheetStringToArray with NL as delimiter
- limit the resulting array to have exactly 10 elements (aka lines), using ArraySubset after appending another 10 elements (containing empty strings)
- convert the array back to your string (or write directly to your file)…
Example: