Skip or delete lines between two keywords in a file using python

2

The problem is I need to skip or delete all the lines between the two keywords in a file and the keyword pair will appear many times in the file.The file looks something like this

.
.
..........
..........
Hello world
..........
..........
welcome
.
.
.
..........
..........
Hello world
..........
..........
welcome
.
.
.
.........
.........
Hello world
..........
..........
welcome
.
.
.
..........
..........

Here the contents between Hello world and welcome are to be deleted (including those keywords). Please help me out with this.

user68680

Posted 2017-04-30T09:29:14.443

Reputation: 21

Question was closed 2017-04-30T09:35:28.980

1

Welcome to PPCG! Please note that this site is for challenges, not general questions on programming. You may want to ask your question on stackoverflow instead.

– Leaky Nun – 2017-04-30T09:31:43.087

No answers