CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
email extractor



Nov 14, 2000, 10:13 PM

Post #1 of 2 (1616 views)
email extractor Can't Post

I need a program to extract about 1000 email address's from a flat text file. The text file was my mailing list emails but the script went a bit wierd and has added alsorts of random letters in there as well.
it looks something like this now;
fjfjdjl;d;' kdkdkdkksjs dwnefe etc.

freeware would be good.


Nov 15, 2000, 11:39 AM

Post #2 of 2 (1616 views)
Re: email extractor [In reply to] Can't Post

I thought this would be a usefull little script so I wrote one for your needs.

Did you happen to get the other script working?

Edit my post to cut & paste the following code.

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

# Addy Seeker 1.0
# --- Author --- #
# Sleuth
# Contact:
# --- Copywrite --- #
# GNU Public License
# --- Installation --- #
# Upload, chmod, configure variables accordingly
# must be uploaded in ascii mode
# You must have an ftp client, if you don't have one go to "" and click downloads at the left
# Or, search for "best ftp" at and you can get the same one, it's a very good ftp client.
# --- Notes --- #
# Requested by benjaminlawrie at the forums
# Please visit for all of your perl needs & questions
# coming soon as of now, great scripts done professionally and custom programming will be available
# ---- End --- #
print "Content-type: text/html\n\n";
$htmlfile = '/path/to/file.html'; # this is the file with the email addresses in it
$done_file = '/path/to/donefile.db'; # this is the file it will save the addys to, it must exist.
$append = "1"; # if this is 1 it will write the email addresses to the end of the $done_file, if it's nothing & just blank,
# it will overwrite the file everytime with the email addresses it finds from $htmllfile.
open(data, "<$htmlfile");
while(<data> ){
if ($_ =~ m,(\s.*?\@.*?\..+?\s), &#0124; &#0124; $_ =~ m,(^.*?\@.*?\..+?\s),){
($addy = $1) =~ s!^\s!!;
if (!$append){
open(file, ">$done_file");
print file @addys;
open(file, ">>$done_file");
print file @addys;
print qq~<p algin="left"><font face="verdana" color="880000" size="2">Finished:<br>"$count" Email address found.</font></p>~;



Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives