Skip to content

Instantly share code, notes, and snippets.

View ajslaghu's full-sized avatar

Lex Slaghuis ajslaghu

View GitHub Profile
@ajslaghu
ajslaghu / extract_emails_from_text.py
Created May 17, 2018 08:53 — forked from dideler/example.md
A python script for extracting email addresses from text files. You can pass it multiple files. It prints the email addresses to stdout, one address per line. For ease of use, remove the .py extension and place it in your $PATH (e.g. /usr/local/bin/) to run it like a built-in command.
#!/usr/bin/env python
#
# Extracts email addresses from one or more plain text files.
#
# Notes:
# - Does not save to file (pipe the output to a file if you want it saved).
# - Does not check for duplicates (which can easily be done in the terminal).
#
# (c) 2013 Dennis Ideler <ideler.dennis@gmail.com>