Aug-10-2020, 11:01 PM
Worked, needed a minor tweak to make it work for the very last line as well
with open("file1", 'r') as fileA, open("file2", 'r+') as fileB: line_start = fileB.tell() line1 = fileA.readline() line2 = fileB.readline() while line1 and line2: if line1 == line2: replace = "00" fileB.seek(line_start) fileB.write(replace) line_start = fileB.tell() if line1 != line2: line1 = fileA.readline() line2 = fileB.readline()Thanks!