Good I have the following code that looks for a number in this column and then prints some lines that are above and below:
import collections
import sys
import itertools
with open(archivo.txt) as f:
before = collections.deque(maxlen=3)
for line in f:
if "UN_NRO" in line[50:60]:
sys.stdout.writelines(before)
sys.stdout.write(line)
sys.stdout.writelines(itertools.islice(f, 10))
break
before.append(line)
I need to save all those lines in another file "summary.txt" I appreciate your help