Can I filter and sort email ids in notepad++ and other text editors?

1

I have a txt file which has around 20000 email id. I want to know email count from gmail, yahoo, ymail, googlemail, aol, live,custom domain, gmx, and other temporary emails separately. And also i need to filter them and sort them in email domain order. How can i do that using notepad++? If any other program make this much easier than notepad ++ please refer that too.

Dhinesh

Posted 2014-11-17T10:23:40.607

Reputation: 13

Answers

1

I would do this in Excel

Copy the list into Column A of Excel. Excel will let you sort (and remove duplicates if needed).

From there, this macro will do it

Sub DoTheThing()

Range("C:D").Cells.ClearContents

Dim row As Integer
row = 1

Do While (Range("A" & row).Value <> "")

    Dim emails() As String
    emails = Split(Range("A" & row).Value, "@")
    Dim domain As String

    Dim i As Integer

    'domain = emails(1)         commented out. Use this line if you want to include .com or .net
    domain = Split(emails(1), ".")(0)   'use this line if you want just the provider, such as GMAIL or Yahoo

    Dim resultsRow As Integer
    resultsRow = 1

    Dim resultExists As Boolean
    resultExists = False

    Do While (Range("C" & resultsRow).Value <> "")

        If (Range("C" & resultsRow).Value = domain) Then
            Range("D" & resultsRow).Value = Range("D" & resultsRow).Value + 1  ' add 1
            resultExists = True
        End If

    resultsRow = resultsRow + 1
    Loop

    If (resultExists = False) Then
        Range("C" & resultsRow).Value = domain
        Range("D" & resultsRow).Value = 1
    End If


row = row + 1

Loop

End Sub

Code above assumes your original list is all lower case

Screen shots of before and after, showing the provider occurrences

Before

enter image description here

After

enter image description here

Dave

Posted 2014-11-17T10:23:40.607

Reputation: 24 199

thank you for your perfect reply to my question... but i have no idea what macro is. I have loaded the email list to excel. don't know how to proceed further and what to do with the code. your screenshot clearly says that this the solution for me.... – Dhinesh – 2014-11-17T14:23:07.003

@Dhinesh see http://superuser.com/questions/801609/how-do-i-add-vba-in-ms-office

– Dave – 2014-11-17T14:26:16.687

thank you very much... the question is answered and i am able to do it with ease... well done @Dave... – Dhinesh – 2014-11-17T15:09:54.143