Skip to content

Instantly share code, notes, and snippets.

@benjohnde
Last active July 18, 2018 13:41
Show Gist options
  • Select an option

  • Save benjohnde/6164ba9452a035b006af7a45bd0a3cc8 to your computer and use it in GitHub Desktop.

Select an option

Save benjohnde/6164ba9452a035b006af7a45bd0a3cc8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import csv
import re
with open('customer_interview_list.csv') as file:
reader = csv.reader(file, delimiter=';')
for row in reader:
column = row[13]
column = column.strip() # remove unnecessary whitespace
if not column: continue
emails = re.findall(r'[\w\.-]+@[\w\.-]+\.[\w]+', column)
if not emails: continue
emails = list(set(emails)) # removes duplicates because a set is supposed to have unique entries
print("E-Mails Found: {}".format(emails))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment