Hi All,
I wanted to extract string from the message using regular expression. right now i used instr & substr to achieve my output.
but i wanted to try reg. exp. can you please assist me to achieve the output.
first extract the string between MED and SI
second extract the string from first line to till "-"
third extract the string between "-" & "-"
MED
AA888/03.A6BMF.J32Y304.2/11
-AAA.187/121/1/1.0.T9441.2/6232.3/2490.4/560.5/159.PAX/21/288
.JMP/0.CRW/0.PAD/1/0
.JRR/0.CRW/0.PAD/1/0
-BBB.9/11/0/0.0.T9736.1/284.2/2827.3/968.4/5500.5/157.PAX/4/16
.JMP/0.CRW/0.PAD/0/0
SI PEK FRE 2703 POS 7 BAG 5718 TRA
MED
AA889/03.A6BMF.J32Y304.2/11
-AAA.197/121/1/1.0.T9441.2/6232.3/2490.4/560.5/159.PAX/21/288.JMP/0.CRW/0.PAD/1/0
-BBB.9/11/0/0.0.T9736.1/284.2/2827.3/968.4/5500.5/157.PAX/4/16.JMP/0.CRW/0.PAD/0/0
SI PEK FRE 2703 POS 7 BAG 5718 TRA
MED
AA999/03.A6BMF.J32Y304.2/11
-AAA.197/121/1/1.0.T9441.2/6232.3/2490.4/560.5/159.PAX/21/288.JMP/0.CRW/0.PAD/1/0
SI PEK FRE 2703 POS 7 BAG 5718 TRA
Expected output
col1 col2
AA888/03.A6BMF.J32Y304.2/11 -AAA.197/121/1/1.0.T9441.2/6232.3/2490.4/560.5/159.PAX/21/288.JMP/0.CRW/0.PAD/1/0.JRR/0.CRW/0.PAD/1/0
AA888/03.A6BMF.J32Y304.2/11 -BBB.9/11/0/0.0.T9736.1/284.2/2827.3/968.4/5500.5/157.PAX/4/16.JMP/0.CRW/0.PAD/0/0
AA889/03.A6BMF.J32Y304.2/11 -AAA.197/121/1/1.0.T9441.2/6232.3/2490.4/560.5/159.PAX/21/288.JMP/0.CRW/0.PAD/1/0
AA889/03.A6BMF.J32Y304.2/11 -BBB.9/11/0/0.0.T9736.1/284.2/2827.3/968.4/5500.5/157.PAX/4/16.JMP/0.CRW/0.PAD/0/0
AA999/03.A6BMF.J32Y304.2/11 -AAA.197/121/1/1.0.T9441.2/6232.3/2490.4/560.5/159.PAX/21/288.JMP/0.CRW/0.PAD/1/0