Tcl question



I am new to TCL and i have project to do in TCL.

when there are mutilple OBR segments in a result messgae. I need to
take OBR-2 from all segments and then send them in reverse to the
output system in TX-14 field (MDM message as Output)

Example:-- OBR|1|475678
OBR|2|475679
OBR|3|475677
------ as input ------------------------------------

This is as output

TXA|475677~475679~475678|

Thanks in advance

Chris
.