


The script needs to process the text file for the purpose of extracting only the required data and deleting (getting rid of) everything else.
I need the script to make sure the origianl text file remains intact and unchanged so it will need to output a new text file with the results and leave the one being processed unchanged.
All of the data that I need the script to keep always follows the same format contained within the double quotes below:

""
Result 200 of 200

Hearing Type: Bail Hearing
Judicial Officer: Borer, George

Hearing Date: 04/25/2023 01:30 PM
Result: Held On the Record
Hearing Location: Hennepin County, Hennepin Criminal, GC-C456

Case Number: 27-CR-20-8575
Case Title: State of Minnesota vs Bisharo Jama Noor
Case Type: Crim/Traf Mandatory
Case Location: Hennepin County, Hennepin Criminal Downtown
""

Where the 'static' and unchanging elements would be the following from the above example (contained in double quotes):

""
Result

Hearing Type:
Judicial Officer:

Hearing Date:
Result:
Hearing Location:

Case Number:
Case Title:
Case Type:
Case Location:
""

The format of the data I need always maintains the same number of rows insofar as occupying a total of 13 rows and begenning with the "Result" string and ending with the "Case Location:" string

The scripts resulting output for the example provided would output the following FOR EACH identified block in the text file in the following way (contained in double quotes):

""
Hearing Type: Bail Hearing
Judicial Officer: Borer, George
Hearing Date: 04/25/2023 01:30 PM
Result: Held On the Record
Hearing Location: Hennepin County, Hennepin Criminal, GC-C456
Case Number: 27-CR-20-8575
Case Title: State of Minnesota vs Bisharo Jama Noor
Case Type: Crim/Traf Mandatory
Case Location: Hennepin County, Hennepin Criminal Downtown

""

So the resulting output text file that will contain multiple entries would look follow the formatting and structure of the following example (containe din the double quotes):

""
Hearing Type: Evidentiary Hearing
Judicial Officer: Borer, George
Hearing Date: 03/22/2023 09:00 AM
Cancelled; Other
Hearing Location: Hennepin County, Hennepin Probate Mental Health, GC-C456
Case Number: 27-CR-22-10231
Case Title: State of Minnesota vs Emmanuel Louis Mohs
Case Type: Crim/Traf Mandatory
Case Location: Hennepin County, Hennepin Criminal Downtown

Hearing Type: Evidentiary Hearing
Judicial Officer: Borer, George
Hearing Date: 03/22/2023 09:00 AM
Cancelled; Other
Hearing Location: Hennepin County, Hennepin Probate Mental Health, GC-C456
Case Number: 27-CR-22-18941
Case Title: State of Minnesota vs Emmanuel Louis Mohs
Case Type: Crim/Traf Mandatory
Case Location: Hennepin County, Hennepin Criminal Downtown

Hearing Type: Hearing
Judicial Officer: Borer, George
Hearing Date: 03/21/2023 01:30 PM
Result: Held On the Record
Hearing Location: Hennepin County, Hennepin Criminal, GC-C456
Case Number: 27-CR-17-28215
Case Title: State of Minnesota vs Samuel Omwando Nyaboga
Case Type: Crim/Traf Mandatory
Case Location: Hennepin County, Hennepin Criminal Downtown

""

The text file output would be named the same as the input text file except it will have "-01" added to the end of it. So a text file named "Example.txt" would be output as "Example-01.txt"

All other text that doesn't follow the 13 row rule as identified above insofar as the beginning and end string that should be used to identify the valid blocks of text should be deleted and not included as part of the output text file. 
So the script needs to work from the top down and find the string "Result" while making sure it is not incorrectly identifying the other "Result:" string that is actually contained within the data that needs to be output in the resulting text file.































