Retrieving e-mail addresses from guestbook

Can anyone help me with a script that can retrieve e-mail addresses from my guestbook so that I may e-mail them?
kch011099Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

guadalupeCommented:
I think I can.  First you need to be a little more specific and next maybe post a sample of the Guest Book data file...
0
kch011099Author Commented:
Guestbook example:
-------------------------------------
I would like to thank you for an exciting season!! You are a GREAT team and you are WONDERFUL role models who display class and good sportsmanship!! Looking forward to another wonderful season next year!!
K
Kim <Kvilagi@email.net>
San Souci, FL - Sunday, January 23, 2000 at 17:23:34 (EST)
-------------------------------------

I would like to retrieve the e-mail address and put it in another file so that it can be used in a Netscape address book to send thank you e-mails.
0
guadalupeCommented:
A simple answer is:

open(FILE,"guest_book_dat.txt");
open (EMAILS,">emails.txt");

while (<FILE>)
{

if (/<(.+)>/)
{
    print EMAILS "$1\n";
}

}

close(FILE);
close(EMAILS);



This program will get out all the emails and print them to a txt file on per line.

Is that about what you wanted?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

guadalupeCommented:
Did this help?
0
kch011099Author Commented:
I couldn't get it to work. I don't think my files are being read correctly.
0
guadalupeCommented:
Did it give you any errors?  I used the sample you gave from your guestbook and the exact code I posted and I got the email: Kvilagi@email.net

It works for me.  Try this and see if you get any output to the screen:

open(FILE,"guest_book_dat.txt");
open (EMAILS,">emails.txt");

while (<FILE>)
{

if (/<(.+)>/)
{
    print "$1\n";
    print EMAILS "$1\n";
}

}

close(FILE);
close(EMAILS);





0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.