Goal
I have downloaded a CSV file from hotmail, but it has a lot of duplicates in it. These duplicates are complete copies and I don\'t know why my
You can use the following script:
pre-condition:
1.csv is the file that consists the duplicates2.csv is the output file that will be devoid of the duplicates once this script is executed.code
inFile = open('1.csv','r')
outFile = open('2.csv','w')
listLines = []
for line in inFile:
if line in listLines:
continue
else:
outFile.write(line)
listLines.append(line)
outFile.close()
inFile.close()
Algorithm Explanation
Here, what I am doing is: