Are there several messages in a file? If not a simple fix would be a one line Tcl proc, assuming each line is a segment, to substitute newline with the empty string:
msgset $mh [string map “\n {}” [msgget $mh]]
return “{CONTINUE $mh}”
Leaving each segment terminated with the CR as it should be
If multiple messages in the file a little more is needed. Do same as above except
set msgs [string map “\n {}” [msgget $mh]]
set msgs [string trimleft [string map “MSH| \nMSH|” $msgs]] ;# all but last has LF
msgsset $mh “” ;# save time copying if large file
set dispList
;# Kill original
Then in a loop:
foreach msg [split $msgs \n] {
set newmh [msgcopy $mh]
msgset $newmh $msg
lappend dispList “CONTINUE $newmh”
}
return $dispList
This is off the top of my pointed head so may be some fat finger errors but that is the gist of it.