Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sachin,88
- sehwag,98
- sachin,89
- dhoni,68
- virat,98
- dhoni,67
- sachin,99
- sehwag,98
- dhoni,78
- virat,89
- virat,25
- 2 records found for sachin in input1.csv
- 1 record found for sachin in input2.csv
- 2 records found for dhoni in input1.csv
- 1 record found for dhoni in input2.csv
- 1 record found for virat in input1.csv
- 2 records found for virat in input2.csv
- import csv
- f = csv.reader(open('infile.csv','rb'))
- writer = csv.writer(open('outfile.csv','wb'))
- names= set()
- i tried with something like below , but it dint work
- # count all the emails before we write anything out
- names = Counter()
- for row in f:
- names+=Counter([row[0]])
- # now write the file
- for row in names.items():
- writer.writerow(row)
Add Comment
Please, Sign In to add comment