I am working on a charges interface and facing some issue replacing “&” character with “and” in FT1 7 field while writing a tcl proc.
What i am doing is as follows:
I remove MSH 0 to 7 and get 8 to end of message using a string range function and store it in a variable “temp”. Then i use a replace function and replace “&” with “and” for the entire message. After replacing, the “&” i join the entire message stored in temp with the 1 to 7 characters of MSH in order to get the complete message. This seems to be working now.
But in future, there can be instances where the message might contain the true delimiter “&” that we dont need to replace with “and” .
If we have the replacable & in a particular sub field (FT1 7), is there a way that we can get just that particular filed and replace it with desired character keeping the entire message untouched.
This needs to be done in a tcl proc.
Thanks in advance.