Last active
November 27, 2019 13:57
-
-
Save rootux/548be248410022636c0e913562fabff5 to your computer and use it in GitHub Desktop.
Clean [email protected] to be [email protected]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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