Let's say I have two CSV files and In the third CSV file, I want to print the difference between those CSV files.
First CSV has an old list of hash
Second CSV has the new list of hash which will have both old and new hash.
This is my code:
import csv
t1 = open('old.csv', 'r')
t2 = open('new.csv', 'r')
fileone = t1.readlines()
filetwo = t2.readlines()
t1.close()
t2.close()
outFile = open('update.csv', 'w')
x = 0
for i in fileone:
if i != filetwo[x]:
outFile.write(filetwo[x])
x += 1
outFile.close()
I don't want to use the diff