I am trying to create one OBX-5 segment from the following:
|test1~test2~test3 test4 test5~test6 test7|
The outbound result would look like:
|test1\.br\ test2\.br\ test3 test4 test5\.br\ test6 test7|
So I am trying to read in the entire OBX-5 segment and replace “~” with “\.br\ “. I have tried several things and am able to get “\.br\ ” but that is with an iterate and concat. The issue is that the it would place a “\.br\ ” at the end as well.
What would be nice is to be able to read in the entire OBX-5 as one string or list and then replace “~” with “\.br\ “. However, I have not been able to get that to work. Or to count each element and then iterate and concat them together via a loop which has not worked for me either.
Note that each message will have different number of ~’s (tilde’s).
Any help is very appreciated!