I have a large log file, and I want to extract a multi-line string between two strings: start and end.
start
end
The following is sample from the
Do it with code - basic state machine:
open = False tmp = [] for ln in fi: if 'start' in ln: if open: tmp = [] else: open = True if open: tmp.append(ln) if 'end' in ln: open = False for x in tmp: print x tmp = []