-3
Good morning, I have a text file with more than 2mil tax coupons , but I wanted to extract one by one for the value, for now my code is like this:
import re
txt = open("arqEspelho.txt", "r")
x = re.findall("^cotia", txt)
z = re.findall("ibpt$", txt)
for linhas in txt:
if x and z and "172,20":
print("tem")
else:
print("No match")
but I can’t return the coupon
i need to tell the function that word "COTIA" is the beginning of the coupon and the word "IBPT" is the end of a coupon and if a certain value is among those words, he returns me this coupon.
thank you in advance.
Place a part of the file arqEspelho.txt.
– Bernardo Lopes