here is my current tcl
set msgtext [msgget $mh]
set field_delimiter [cindex $msgtext 3]
foreach segment [split $msgtext “r”] {
if {[cequal [crange $segment 0 2] “OBR”]} {
regsub -all {^} $segment {&} segment
}
if {$segment != “”} {
lappend newmsg $segment }
}
msgset $mh [join $newmsg “r”]
return “{CONTINUE $mh}”
}