Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rootux
Last active November 27, 2019 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rootux/548be248410022636c0e913562fabff5 to your computer and use it in GitHub Desktop.
Save rootux/548be248410022636c0e913562fabff5 to your computer and use it in GitHub Desktop.
Clean gal.b@gmail.com to be galb@gmail.com
# Takes an emails.csv file and output it without any '.'
# run with python3 doocrate-clean-mails.py > cleaned_emails.txt
# also remember to concat the original emails to this output
import csv
with open('emails.csv') as csv_file:
emails = csv.reader(csv_file, delimiter=',')
line_count = 0
for email in emails:
if(email[0].endswith("@gmail.com")):
text, domain = email[0].split("@")
if(text.find(".") != -1):
text = text.replace(".","")
print(text+"@"+domain)
line_count +=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment