I have the following code:
lines = []
with open('myfile.txt') as file:
lines = file.readlines()
line_iter = iter(lines)
for line in line_iter:
pos = line.find("/")
if pos == 6:
str = line[0:5]
str = str.strip()
match str:
case "CASE1":
editedLines.append(line)
case "CASE2":
editedLines.append(line)
case "CASE3":
editedLines.append(line)
in CASE3 I want to add the next lines until I see the CASE3_END How can I get the next line in lines array (in other words skipping a couple of lines from the main for loop)