I have a problem with the handling of txt files, the source file is encoded 'UTF 8-WITHOUT BOM' and I tried to put many "encoding = " but I can't solve this..
Here I attach an image
Right is the origen of file and left is the result
This is the code.
import io
import time
result = io.open("Edificado/edificadoResultadoSinPorBlancos.txt","w")
start = time.time()
print(f"Empece en: {start}")
with io.open("Edificado/edificco.txt","r",errors="ignore") as f:
for line in f:
if '|' in line:
line = line.replace("|","-")
result.write(line)
result.close()
end = time.time()
print(f"Termine en: {end - start}")
(the file weighs 6gb)
Any idea how I could fix it?