I have this block of sample log text:
20190122 09:00,000 ###PERFORMANCE string1 string2 string3
20190122 09:10,500 number1 string1 string2 string3
20190122 09:24,670 number2 string1 string2 string3
20190122 10:05,000 number3 string1 string2 string3
20190122 10:33,960 number4 string1 string2 string3
20190122 11:00,321 number5 string1 string2 string3
20190122 11:40,256 ###PERFORMANCE string1 string2 string3
20190123 10:24,670 number1 string1 string2 string3 string4 date1 number2
20190123 10:32,130 number1 string1 string2 string3 string4 date1 number2
20190123 08:00,000 ###PERFORMANCE string1 string2 string3
20190123 08:10,500 number1 string1 string2 string3
20190123 08:24,670 number2 string1 string2 string3
20190123 09:05,000 number3 string1 string2 string3
20190123 10:33,960 number4 string1 string2 string3
20190123 10:00,321 number5 string1 string2 string3
20190123 13:40,256 ###PERFORMANCE string1 string2 string3
20190124 10:00,000 ###PERFORMANCE string1 string2 string3
20190124 10:10,500 number1 string1 string2 string3
20190124 10:24,670 number2 string1 string2 string3
20190124 11:05,000 number3 string1 string2 string3
20190124 12:33,960 number4 string1 string2 string3
20190124 13:00,321 number5 string1 string2 string3
20190124 13:40,256 ###PERFORMANCE string1 string2 string3
What I would like to do with Python is to detect each ###PERFORMANCE block of text like in this example:
As you can see, there are 3 blocks of interest, each one delimited by the text ###PERFORMANCE in the string.
The first start at line 1 and ends at line 7. What is between line 7 and 10 must not be treated as a block of interest.
Lines of strings for each block could also vary (so going by lines number would not be a good idea).
What I have done until now was just to read the text file line by line:
logFile = "testLog.txt"
with open(logFile) as f:
content = f.readlines()
# you may also want to remove whitespace characters like `\n` at the end of each line
content = [x.strip() for x in content]
for line in content:
print(line)
Which way I could approach to achieve this task ? Would using the NLTK be a good idea ? Would it even work for this task ? Any general suggestion ?

number1 string1 string2 string3or does that mean it will have number and three different strings?