I am having a lot of issues with a seemingly very simple TCL proc. I am bringing in an X12 file and replacing one word if a trigger word exists in the file. I am including two snippets of code, one that works and one that doesn’t. The one that just replaces one word with another seems to work just fine (tested and it just replaced all instances as designed)
The issue is when I try to use a regsub with an IF statement around it I either get “extra characters after closing bracket” —- Which there isn’t, I even rewrote it and brought it into a text editor to verify, or I get “Invalid command name “2” — when I am not calling a command name “2”
Please provide suggestions if you have any. This is very frustrating since it isn’t anything complicated being done.
~Jon