This project is a simple Python script that reads a text file, extracts all valid email addresses using regular expressions (regex), removes duplicates, and saves them to a new file.
- Extracts email addresses from any plain .txt file
- Uses Python's regex (re) module
- Removes duplicate emails
- Saves clean emails to a new file (emails_extracted.txt)
- Fully automatic and easy to use
- task_automation_with_python_scripts.py β The main script
- input.txt β A sample input file containing text with emails
- emails_extracted.txt β Output file with all extracted emails
- Make sure you have Python installed on your system.
- Put the raw text (with emails) into a file named input.txt
- Run the script with this command:
python task_automation_with_python_scripts.py
- Extracted emails will be saved in emails_extracted.txt.
π§ͺ Sample Input and Output
input.txt
Hello Priya, contact us at hr@codealpha.com or support@domain.org.
Backup: test.email@college.edu, admin123@company.inOutput β emails_extracted.txt
hr@codealpha.com
support@domain.org
test.email@college.edu
admin123@company.in