Error
result = ‘list element in quotes followed by “|W|4915” instead of space’
errorInfo: ‘
list element in quotes followed by “|W|4915” instead of space
while executing “lindex $segment 0” (“foreach” body line 3)
Field
PID|||99999999||ZZZZZ^ZZZZZ^ZZZZZ^^||99999999|F|PREFERS “PHYLLIS”|W|4915 SCHOEN R
TCL
set PIDfields [split $segment $fieldSep]
set PIDfields [lreplace $PIDfields 4 4 00000]
set PIDfields [lreplace $PIDfields 2 3 [lindex $PIDfields 3] “”]
set PIDAcct [lindex $PIDfields 18]
regsub -all {T} $PIDAcct {} NewPIDAcct
set PIDfields [lreplace $PIDfields 18 18 $NewPIDAcct]
set segment [join $PIDfields $fieldSep]
set segmentList [lreplace $segmentList $i $i $segment]
Thanks
Tim