Create a script to find and delete certain text in a txt

Job ID: 36438167

Budget: $10 – $15 USD

I'm looking to create a python script in order to find and delete certain text in a transcript txt file, so that only the quotes from certain names are kept.

Example:

John Smith
Lorem ipsum 1.

Chris Johnson
Lorem ipsum 2.

John Smith
Lorem Ipsum 3.

Sam Washington
Lorem Ipsum 4.

Would be filtered so that only the quotes (the lines that immediately follow the name) from certain names are kept in a new txt file.

In this example, if I wanted to keep all quotes from John Smith and Sam Washington, the output would be:

Lorem ipsum 1.

Lorem ipsum 3.

Lorem ipsum 4.

I need the .py script, the command required that I put into Powershell, and any other relevant information to make it work.
Related categories: Python Shell Script