I'm trying to loop through a file and replace all instances of several things.. It's working SOME of the time, but it's missing values that it correctly replaced earlier in the file and I have no idea why it won't work every time.
with open("myfile", "rt") as filein:
with open("mynewfile", "wt") as fileout:
for line in filein:
fileout.write(line.replace('a', 'b'))
fileout.write(line.replace('c', 'd'))
fileout.write(line.replace('e', 'f'))
fileout.write(line.replace('g', 'h'))
fileout.write(line.replace('i', 'j'))
fileout.write(line.replace('k', 'l'))
print("Done")