A Python automation project that extracts email addresses from a text file and saves the unique results into a separate output file.
- Reads text from
input.txt - Finds valid email addresses using regular expressions
- Removes duplicate email addresses
- Saves extracted emails to
extracted_emails.txt - Handles missing input files gracefully
- Python
remodule- File handling
email_extractor project/
├── email_extractor.py
├── input.txt
├── extracted_emails.txt
└── Readme.md
- Open the
email_extractor projectfolder. - Add text containing email addresses to
input.txt. - Run the script:
python email_extractor.py- Check
extracted_emails.txtfor the extracted results.
Input:
Contact us at [email protected] or [email protected].
Output:
Ashutosh Tiwari