Originally posted by Mark Perschbacher
As part of this huge data conversion project I have been hammering on, I need to append x0a to OBX 5. I have been playing around with what seems like the standard method for altering and rebuilding messages.
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?