0
I am trying to search for a value at a certain position in the column of a text file and generating another file with these lines, but without success
Follows 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()
It really was just that detail in the column position! And it did not generate any error, only the empty file, but it worked out by adjusting the position. Thank you!
– Jamerson Rodrigo