A simple Python script that extracts email addresses from an Excel spreadsheet and saves them to a text file. This tool is particularly useful for extracting email addresses from Google Form responses exported to Excel.
- Extracts email addresses from a specified Excel column
- Works with Google Form response spreadsheets by default
- Saves extracted emails to a text file
- Handles empty cells gracefully
- Prints extracted emails to console
- Python 3.x
- openpyxl library
- Clone the repository:
git clone https://github.com/aatikah/email-extractor.git
cd email-extractor
- Install the required package:
pip install openpyxl
- Place your Excel file in the same directory as the script
- Update the
file_path
variable with your Excel file name:
file_path = 'your_file_name.xlsx'
- Run the script:
python email_extractor.py
The extracted emails will be:
- Printed to the console
- Saved to
emails.txt
in the same directory
You can customize the following parameters:
sheet_name
: Default is 'Form Responses 1' ( 5E19 standard Google Forms sheet name)email_column_name
: Default is 'Email Address'output_file
: Default is 'emails.txt'
# Custom configuration
emails = extract_email_column(
file_path='responses.xlsx',
sheet_name='Sheet1',
email_column_name='User Email'
)
The script will raise a ValueError if:
- The specified email column is not found
- The Excel file cannot be opened
- The specified sheet name doesn't exist
⭐ If you find this project helpful, please give it a star!
- Support me- buymeacoffee.com/aatikah
- Connect with me on LinkedIn: LinkedIn Profile