If you can reasonably predict what your lines might contain, using regex would be my go-to-solution.
import re
re_pattern = re.compile(r"This is line [37]")
# The above is used to match "This is line " exactly, followed by either a 3 or a 7.
# The r before the quotations mean the following string should be interpreted literally.
output_to_new_csv = []
print_following_line = False
for line in csv_lines:
if print_following_line:
print(line)
output_to_new_csv.append(line)
print_following_line = False
if re.match(re_pattern, line):
print_following_line = True
# Then write output to your new CSV
The code initially sets print_following_line to False since you don't know if you want print the next line. If your regex string matches the current line, your print_following_line bool will be set to True. It will then print the next line and add it to your output list which you can write to a CSV later.
If you are new to regex, this website is incredibly helpful for debugging and testing matches: https://regex101.com/