I am trying to search for a value in a certain position in the column of a text file and generating another file with these lines, but without success
Follow the code:
arquivo = open('arquivo.txt', 'r')
arquivo2 = open('arquivo2.txt', 'w')
for i in arquivo.readlines():
if i[70:71] == '02':
arquivo2.write(i)
print(i.rstrip())
arquivo.close()
arquivo2.close()