I have a text file (mylog.txt) that currently stores login
information for our users. I need to parse and extract some basic
information from the file and I am having a hard time. I need to
know the following
1. A list of all UNIQUE email addresses that appear in the
2. A count of how many times each email address appears
Each time a user logs on a "new line" is entered in the text
file. Here is some sample data:
[1/05/08 1:15:31 PM] User email@example.com logged in.
[1/11/08 3:57:30 PM] User firstname.lastname@example.org logged in.
[1/12/08 8:33:17 PM] User email@example.com logged in.
[2/17/08 6:37:07 AM] User firstname.lastname@example.org logged in.
[2/19/08 3:57:30 PM] User email@example.com logged in.
I would like to parse the text file and then output my
results to the screen. The output should look like this, note John
logged in twice: