Undoubtedly each line terminated by \.br\ in the OBX-5 contains spaces so adding another space does not properly terminate each line otherwise once the space were in place (in a temp variable for example) you could treat the data element as a list. If on Cloverleaf 19.1 the ‘User’ repetition type in an ITERATE would allow you to work through the list repetitions.
So in your existing Tcl proc make your output a Tcl list using list commands so that you get something like this:
some data 1\.br\some data 2\.br\…
becomes something like this:
{{some data 1}{some data 2}…}
The above could also be done using the STRING Action map function and a CONCAT without Tcl if you so decide.
Then if on 19.1 as indicated above use the User Type in an ITERATE. If not on 19.1 then using the List Type ITERATE with a basis of 0, using %l1 counter, and 1 and a Tcl proc to extract each element on your list returning the most current element and the remaining list and null in the most current element when the end of your list is reached.
Inside the ITERATE if the element retrieved is not eq @null COPY =0 to $%l1 and COPY the current element returned to the next repetition of the OB OBX (you will need to manage your own counter).
I have a proc that will extract current element and return current element and remaining list as well as a null when the list is exhausted. If you want that proc, email me.
If you have questions about how to use the List ITERATE as I described above, email me.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.