Gaetan,
Regsub is not my forte but…
I used regsub -all — {\T\} $name {/T/} tmp and that seemed to work OK.
By the way, the T is correct notation in an HL/7 text field to represent imbedded subcomponent separator, /T/ is not.
If the receiving system wants the latter, they are not following the standard and, in my opinion, should change their code.
Jim Kosloskey
email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.