foreach segment $obx {
set field [split $segment $fieldSep]
set afield [lindex $field 5]
append field ” x0a”
set sfield [join $field r]
#set final
#set field [lappend $field 5 5 $cr]
#set field [join $field $fieldSep]
set subf [lindex $sfield 5]
set obx6 [lreplace $subf 0 end $obxlist2]
set sfield [lreplace $sfield 0 end $obx6]
set segment [join $field $fieldSep]
}
This approach seems to work fine for substituting values for a given subfield, but not for appending a string to all iteration of that subfield. If there was a way to use a combination of lappend and lreplace, I think it would work. Any ideas?