How to extract email addresses from a text file using notepad+
Given the following text file as input there are 3 easy steps to follow so that you can extract all email addresses contained inside the text.
![Text containing email addresses](http://kniko.net/wp-content/uploads/2016/07/text-with-emails-300x169.jpg)
1st Step – Find email addresses using regex match
Use the find & replace feature of notepad++
Find: (\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}\b)
Replace: \r\n$&\r\n
this adds and new line before and after each email address.
![Email address in new line](http://kniko.net/wp-content/uploads/2016/07/email-in-new-line-300x203.jpg)
Step 2 – Mark email addresses and bookmark lines
Mark: (\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}\b)
have “Bookmark Line” checked.
Step 3 – Remove unmarked lines
Search > Bookmark > Remove Unmarked Lines
![Remove unmarked lines in Notepad++](http://kniko.net/wp-content/uploads/2016/07/remove-unmarked-lines-245x300.jpg)
Leave a Reply