Hi Alise,
The error could be in these lines:
set splitSeg [split $seg *]
set Fld1 [string range $splitSeg 0 1]
The split is ok but you’re creating a list of fields where the first field is actually the segment ID or “CAS”. So when you get the first two characters you get “CA” instead of what you expect.
Instead of using ‘string range’ use lindex and get the second element which should be the field that “CO” is in.
So:
set Fld1 [lindex $splitSeg 1]