I’ve got a requirement to run a python script that will remove blocks/rows of text between two predictable comment blocks.
Let’s say I have a file like this
## Start of Part 1
Some text
Some more text
A bit more text
## End of Part 1
## Start of Part 2
Some text again
Some more text again
A bit more text again
## End of Part 2
I want to delete all the rows between ## Start of Part 1
and ## End of Part 1
, including the comment lines
Is there a way with python to do that?