A solution would be:
set finalmsgf [join “$mshs $PIDsegmentall $PV1segmentall $restmsg” r]
where “$mshs $PIDsegmentall $PV1segmentall $restmsg” is a list and the ‘join’ command creates a single element from the list with a r between each of the original list elements.