Skip to content

Instantly share code, notes, and snippets.

@rootux
Last active November 27, 2019 13:57
Show Gist options
  • Select an option

  • Save rootux/548be248410022636c0e913562fabff5 to your computer and use it in GitHub Desktop.

Select an option

Save rootux/548be248410022636c0e913562fabff5 to your computer and use it in GitHub Desktop.

Revisions

  1. rootux revised this gist Nov 27, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion doocrate-clean-mails.py
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Takes an emails.csv file and output it without any '.'
    # run with doocrate-clean-mails.py > cleaned_emails.txt
    # run with python3 doocrate-clean-mails.py > cleaned_emails.txt
    # also remember to concat the original emails to this output
    import csv

  2. rootux created this gist Nov 27, 2019.
    15 changes: 15 additions & 0 deletions doocrate-clean-mails.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    # Takes an emails.csv file and output it without any '.'
    # run with 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