This is my data file:
UNA:+.? 'UNB+UNOA:3+CHASE:ZZ+ADSD:ZZ+030718:0103+00000000000630'UNH+0000
0000000326+CRL:2:2:UN'UCI+47000618072003+EV1:ZZ+CH:ZZ+7'UNT+3+000
00000000326'UNZ+1+00000000000630'
UNA:+.? 'UNB+UNOA:3+ss+WER:ZZ+030718:0110+00000000000631++BTS'
UNH+00000000012689+BTS:96A:UN'BGM+XZ8+1'DTM+137:20030718:102'LIN+1'RFF+XC3:
F2003-07-18-06.00.47.168473'RFF+AEK:03071806000002'RFF+CR:EXM 1000735AT1ZD'SE
Q++1'GIS+1'UNT+10+00000000012689'UNH+00000000012690+BTS:96A:UN'BGM+XZ8+2'DT
M+137:20030718:102'LIN+1'RFF+XC3:F2003-07-18-06.00.47.168473'RFF+AEK:03071806
000002'RFF+CR:EXM 1000736P139G'SEQ++1'GIS+1'UNT+10+00000000012690'UNH+0000000001
2691+BTS:96A:UN'BGM+XZ8+3'DTM+137:20030718:102'LIN+1'RFF+XC3:F2003-07-18
-06.00.47.168473'RFF+AEK:03071806000001'RFF+CR:EXM 1000939I361H'SEQ++1'GIS+1'UNT
+10+00000000012691'UNH+00000000012692+BTS:96A:UN'BGM+XZ8+4'DTM+137:20030718
:102'LIN+1'RFF+XC3:F2003-07-18-06.00.47.168473'RFF+AEK:03071806000003'RFF+CR:
FUS 1000312ASBCA'SEQ++1'GIS+1'UNT+10+00000000012692'UNH+00000000012693+BTS:
96A:UN'BGM+XZ8+5'DTM+137:20030718:102'LIN+1'RFF+XC3:F2003-07-18-06.00.47.1684
73'RFF+AEK:03071806000003'RFF+CR:FUS 1000313BTJRA'SEQ++1'GIS+1'UNT+10+0000000001
2693'UNH+00000000012694+BTS:96A:UN'BGM+XZ8+6'DTM+137:20030718:102'LIN+1'RFF
+XC3:F2003-07-18-06.00.47.168473'RFF+AEK:03071806000004'RFF+CR:FUS 1006351A1Y
AG'SEQ++1'GIS+1'UNT+10+00000000012694'UNH+00000000012695+BTS:96A:UN'BGM+XZ8
+7'DTM+137:20030718:102'LIN+1'RFF+XC3:F2003-07-18-06.00.47.168473'RFF+AEK:030
71806000004'RFF+CR:FUS 1006352FM3CB'SEQ++1'GIS+1'UNT+10+00000000012695'UNH+00000
000012696+BTS:96A:UN'BGM+XZ8+8'DTM+137:20030718:102'LIN+1'RFF+XC3:F2003-
07-18-06.00.47.168473'RFF+AEK:03071806000004'RFF+CR:FUS 1006353MC65A'SEQ++1'GIS+
1'UNT+10+00000000012696'UNH+00000000012697+BTS:96A:UN'BGM+XZ8+9'DTM+137:200
30718:102'LIN+1'RFF+XC3:F2003-07-18-06.00.47.168473'RFF+AEK:03071806000004'RF
F+CR:FUS 1006354Q29AA'SEQ++1'GIS+1'UNT+10+00000000012697'UNH+00000000012698+BANS
TA:96A:UN'BGM+XZ8+10'DTM+137:20030718:102'LIN+1'RFF+XC3:F2003-07-18-06.00.4
7.168473'RFF+AEK:03071806000004'RFF+CR:FUS 1006355R175B'SEQ++1'GIS+1'UNT+10+0000
0000012698'UNH+00000000012699+BTS:96A:UN'BGM+XZ8+11'DTM+137:20030718:102'LI
N+1'RFF+XC3:F2003-07-18-06.00.47.168473'RFF+AEK:03071806000004'RFF+CR:FUS 100
6356V353U'SEQ++1'GIS+1'UNT+10+00000000012699'UNZ+11+00000000000631'
what I need to do is get out all text that starts with - UNH
and ends with - UNT
so the script should return
UNH+0000
0000000326+CRL:2:2:UN'UCI+47000618072003+EV1:ZZ+CH:ZZ+7'UNT
UNH+00000000012689+BTS:96A:UN'BGM+XZ8+1'DTM+137:20030718:102'LIN+1'RFF+XC3:
F2003-07-18-06.00.47.168473'RFF+AEK:03071806000002'RFF+CR:EXM 1000735AT1ZD'SE
Q++1'GIS+1'UNT
and so on
Thanks for your help
UNA:+.? 'UNB+UNOA:3+CHASE:ZZ+ADSD:ZZ+030718:0103+00000000000630'UNH+0000
0000000326+CRL:2:2:UN'UCI+47000618072003+EV1:ZZ+CH:ZZ+7'UNT+3+000
00000000326'UNZ+1+00000000000630'
UNA:+.? 'UNB+UNOA:3+ss+WER:ZZ+030718:0110+00000000000631++BTS'
UNH+00000000012689+BTS:96A:UN'BGM+XZ8+1'DTM+137:20030718:102'LIN+1'RFF+XC3:
F2003-07-18-06.00.47.168473'RFF+AEK:03071806000002'RFF+CR:EXM 1000735AT1ZD'SE
Q++1'GIS+1'UNT+10+00000000012689'UNH+00000000012690+BTS:96A:UN'BGM+XZ8+2'DT
M+137:20030718:102'LIN+1'RFF+XC3:F2003-07-18-06.00.47.168473'RFF+AEK:03071806
000002'RFF+CR:EXM 1000736P139G'SEQ++1'GIS+1'UNT+10+00000000012690'UNH+0000000001
2691+BTS:96A:UN'BGM+XZ8+3'DTM+137:20030718:102'LIN+1'RFF+XC3:F2003-07-18
-06.00.47.168473'RFF+AEK:03071806000001'RFF+CR:EXM 1000939I361H'SEQ++1'GIS+1'UNT
+10+00000000012691'UNH+00000000012692+BTS:96A:UN'BGM+XZ8+4'DTM+137:20030718
:102'LIN+1'RFF+XC3:F2003-07-18-06.00.47.168473'RFF+AEK:03071806000003'RFF+CR:
FUS 1000312ASBCA'SEQ++1'GIS+1'UNT+10+00000000012692'UNH+00000000012693+BTS:
96A:UN'BGM+XZ8+5'DTM+137:20030718:102'LIN+1'RFF+XC3:F2003-07-18-06.00.47.1684
73'RFF+AEK:03071806000003'RFF+CR:FUS 1000313BTJRA'SEQ++1'GIS+1'UNT+10+0000000001
2693'UNH+00000000012694+BTS:96A:UN'BGM+XZ8+6'DTM+137:20030718:102'LIN+1'RFF
+XC3:F2003-07-18-06.00.47.168473'RFF+AEK:03071806000004'RFF+CR:FUS 1006351A1Y
AG'SEQ++1'GIS+1'UNT+10+00000000012694'UNH+00000000012695+BTS:96A:UN'BGM+XZ8
+7'DTM+137:20030718:102'LIN+1'RFF+XC3:F2003-07-18-06.00.47.168473'RFF+AEK:030
71806000004'RFF+CR:FUS 1006352FM3CB'SEQ++1'GIS+1'UNT+10+00000000012695'UNH+00000
000012696+BTS:96A:UN'BGM+XZ8+8'DTM+137:20030718:102'LIN+1'RFF+XC3:F2003-
07-18-06.00.47.168473'RFF+AEK:03071806000004'RFF+CR:FUS 1006353MC65A'SEQ++1'GIS+
1'UNT+10+00000000012696'UNH+00000000012697+BTS:96A:UN'BGM+XZ8+9'DTM+137:200
30718:102'LIN+1'RFF+XC3:F2003-07-18-06.00.47.168473'RFF+AEK:03071806000004'RF
F+CR:FUS 1006354Q29AA'SEQ++1'GIS+1'UNT+10+00000000012697'UNH+00000000012698+BANS
TA:96A:UN'BGM+XZ8+10'DTM+137:20030718:102'LIN+1'RFF+XC3:F2003-07-18-06.00.4
7.168473'RFF+AEK:03071806000004'RFF+CR:FUS 1006355R175B'SEQ++1'GIS+1'UNT+10+0000
0000012698'UNH+00000000012699+BTS:96A:UN'BGM+XZ8+11'DTM+137:20030718:102'LI
N+1'RFF+XC3:F2003-07-18-06.00.47.168473'RFF+AEK:03071806000004'RFF+CR:FUS 100
6356V353U'SEQ++1'GIS+1'UNT+10+00000000012699'UNZ+11+00000000000631'
what I need to do is get out all text that starts with - UNH
and ends with - UNT
so the script should return
UNH+0000
0000000326+CRL:2:2:UN'UCI+47000618072003+EV1:ZZ+CH:ZZ+7'UNT
UNH+00000000012689+BTS:96A:UN'BGM+XZ8+1'DTM+137:20030718:102'LIN+1'RFF+XC3:
F2003-07-18-06.00.47.168473'RFF+AEK:03071806000002'RFF+CR:EXM 1000735AT1ZD'SE
Q++1'GIS+1'UNT
and so on
Thanks for your help