I have a file that I need to parse multiple sections from the file.
The file contains multiple lines that start with ST (Abunch of data)
Then the file contains multiple lines that start with SE (Abunch of data)
SE*300001
ST*8100002
I need all of the lines between and including these.
They are invoices.
The invoice starts with the ST line and ends with the SE line.
I need to break out all of the invoices into separate files.
Can someone please help me. I know Grep, sed, or AWK can do this, but not sure how.
Thank you
Here is an example:
ST*8100001
BIG*20080315*1220680417**SUPPLYDI
N1*SFMCLANE HIGH PLAINS*9246120004
N1*STSWC 7-11 #57134*91571315
N32712 E 8TH ST
N4*ODESSA*TX79761
REF*ST000134
ITD*05*3*****7*****NET 7
IT1**1*CA*20.09**CB*649251*PI*093*UP*099299711018*RANA
TXI*ZZ*1.532
CTP**RES*0***CSR1
PID*F7-11 T-SHIRT BAG 1/7 BBL
PO41000
IT1**1*EA*33.72**CB*834861*PI*093*UP*012253022401*RANA
TXI*ZZ*2.572
CTP**RES*0***CSR1
PID*FKIT CONCRETE CHAMP
PO41
IT1**1*EA*0.03**CB*192849*PI*093*UP*000000192842*RANA
CTP**RES*0***CSR1
PID*FSCS 711 BK 200
PO41
IT1**30*EA*2.59**CB*001511*PI*093*UP*025215102776*RANA
CTP**RES*0***CSR1
PID*FMAXELL T-160 PLUS VIDEO
PO41
TDS18454
SAC*C*G740***5300*******06SERVICE
CTT4
SE*30*0001