How to extract email addresses from text file?
4K views
·
Jan 7, 2022
How to extract email addresses from text file? https://www.ybierling.com/en/blog-officeproductivity-nppextractemailfromfile
Having a file, for example an extraction from your mailbox, and you want to extract only the email addresses ?
Using Notepad++ and simple regular expression, that’s pretty simple.
See below a full example, or, to summarize, open your file, use below regexp to find email addresses, add line breaks before and after each of them, and then mark the lines containing an email address and delete the unmarked lines.
Notepad++ regex extract text
Pretty straightforward – but see below a full example using this clever regexp from a Stackoverflow.com discussion on “Extract email from text using notepad++ and regexp”, and with further inspiration from a superuser.com discussion “How to delete all lines in Notepad++ except lines containing a word I need?”.
(\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}\b)
Starting with your file – in that example, an extraction of the “TO” addresses of an Outlook 2013 sent emails folder – you might have a lot of strange characters, unnecessary text, email addresses on the same line, …
Show More
Show LessComments
loading text loading
loading text loading
loading text
loading text loading
loading text
loading text loading
loading text
loading text loading
loading text