Script to extract character from 3rd position of 5 character ID string contained in a larger string.
set idtext1
[GETVAL ID_TEXT]
# trim blank
characters
set
idtext [string trim $idtext1]
#figure out how
long it is, also if blank
set
msglength [string length $idtext]
# figure out
message start and end positions
set
msgstart [expr $msglength-5]
if
{$msgstart < 0} then {
set msgstart 0
}
set
idstart [expr $msgstart+2]
set
idend $idstart
if {$msglength
> 0} then {
set optext [string range $idtext $msgstart
$msglength]
set opid [string range $idtext $idstart $idend]
SETVAL "OPERATOR_TEXT=$optext"
SETVAL "OPERATOR_ID=$opid"
} else {
SETVAL {OPERATOR_TEXT= }
SETVAL {OPERATOR_ID=0}
}