How to extract email addresses from a text file using notepad++ with no coding at all

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
Text containing email addresses

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

find&replace

this adds and new line before and after each email address.

Email address in new line
Email address in new line

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.

bookmar-email-line

Step 3 – Remove unmarked lines

Search > Bookmark > Remove Unmarked Lines

Remove unmarked lines in Notepad++
Remove unmarked lines in Notepad++

Posted

in

by

Comments

6 responses to “How to extract email addresses from a text file using notepad++ with no coding at all”

  1. Philippe Avatar
    Philippe

    Thanks, this little trick saved my life. Works much better than other solutions I tried before (like Python scripts)

    1. kniko Avatar

      Hi Philippe,

      You are welcome, I am glad this helped someone.

      Best regards.

  2. ADVf Avatar
    ADVf

    Good advice. It is suitable for almost six texts without HTML markup

  3. Pawel Avatar
    Pawel

    thank you. You are a genius

    1. kniko Avatar

      Glad it was helpful!

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.