Skip to content

Instantly share code, notes, and snippets.

@nrm176
Created October 31, 2015 12:22
Show Gist options
  • Save nrm176/c225f5567b06ba667a44 to your computer and use it in GitHub Desktop.
Save nrm176/c225f5567b06ba667a44 to your computer and use it in GitHub Desktop.
import csv
files = [
"a.csv",
"b.csv",
"c.csv",
"d.csv",
"e.csv"
]
BASE_PATH = "base_path/tobedecided"
codes = []
for file in files:
filePath = '%s%s' % (BASE_PATH, file)
with open(filePath, 'r') as f:
reader = csv.reader(f)
header = next(reader)
for row in reader:
codes.append(row[1])
d = {}
for code in codes:
if d.get(code):
d[code]+=1
else:
d[code]=1
for k,v in d.iteritems():
if (v>1):
print k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment