Javascript must be enabled to use this form.

Web Site Search (click below)
Searching With Just One Click

Technology

Multiple Email question

I have a document online that has multiple email address' in different fields. Instead of having to actually click every single one, is there a way to just copy all the email address' on the page with just one click? There is text in between each email address...so if you use the "select all" button, it selects everything. And, i just want the email address. There are probably 1,000 email address' on the one page.


exitjamie  Thurs 24/07/08 21:55
ACtheTROLL
Thurs 24/07/08
22:13
no way that I know
rojash
Fri 25/07/08
01:11
Nor me...
Ice.Maiden
Fri 25/07/08
01:18
Sorry - I don't know much about computers anyway, but can't you just copy and paste the selected areas you need?
fo3nix
Fri 25/07/08
12:13
Excellent Rating
Sure, but not with Acrobat reader or Firefox or something.

You could do it easily with a ruby/perl script, with regular expressions. But this is probably a little advanced.
fo3nix
Fri 25/07/08
16:45
OK just written this in a minute or so.

It takes a text file (plain text -- copy and paste your text into a notepad file, save it as data.txt). I also can't for the life of me remember how to match several email addresses on the same line -- so just go through and press return after each address to make it into a new line.

If your data.txt file now looks something like this:

one jim@yourdomain.com oj0 09 grk iuhgkr df
twooigj f fg uoghd9y dlfd gldf
jones@imp.ac.uk is here. three iof g9d8f yng43 o9
four ogfu h0g8 joe@hotmail.com oig 89 kjg ndkfjg dfg 89 ofd g9df
five 04 godfg 0fd dave.peters@gmail.com, mike@yahoo.com
six09 0tr 8kjgfh ghfgkhgk
seven 0 gkj hkjg kf
eight
nine
ten

Then you can run the following ruby script to grab the email addresses out of it:

#!/usr/local/bin/ruby -w

file = File.new("data.txt")
email_addresses = File.new("email_addresses.txt","w")
file.each do |line|
if line =~ /\b(\w[\w+.]*@\w[\w.]+\w+)\b/ix
email_addresses.print $1, " "
end
end

And it'll give your the addresses, separated by a space, in the file email_addresses.txt.

I'll leave the running of this file as an exercise to the reader :P
exitjamie
Fri 25/07/08
17:22

Question Author

i don't know how to do the ruby script....thanks for your help though...very much!
fo3nix
Fri 25/07/08
19:31
OK, I've found a way to make it easy to use. Follow these steps to try it:

1) Highlight your text in whatever document you have, copy it to the clipboard, and then open notepad (programs -> accessories I think), and paste it in there. Should just be plain text, very boring.

2) goto this site:
http://www.ruby.ch/interpreter/rubyinterpreter .shtml

3) copy and paste the following script into the box on that site, exactly.

######################

file = "



"
#email_addresses = File.new("email_addresses.txt","w")
email_string = ""
file.each_line do |line|
if line =~ /\b(\w[\w+.]*@\w[\w.]+\w+)\b/ix
m = line.scan(/(\w[\w+.]*@\w[\w.]+\w+)+/i)
email_string += m.join(" ") + " "
end
end
puts email_string

######################

4) copy and paste the plain text from in notepad to the gap between where it says file " ...... " at the top of the above script. (Just put them on a new line in between the double-quote characters).

5) Press interpret. You'll get a popup window, which should give you a long list of all your email addresses, all on their own.
fo3nix
Fri 25/07/08
19:34
Excellent Rating
Tip:

Do as I say above, but first try the random text (with a few email addresses) that I put above...

I've just tried it and I get

jim@yourdomain.com jones@imp.ac.uk joe@hotmail.com dave.peters@gmail.com mike@yahoo.com

Bingo!
exitjamie
Fri 25/07/08
19:43

Question Author

OMG! It worked! You are SO SMART! THANKS BUNCHES!!!!!!!!!!!!!!!!!!!!!!!!!
fo3nix
Fri 25/07/08
19:55
You're welcome :)

This also does several email addresses on one line too, I remembered how to do it.

Finally, There are two lines in the above script that look like these:

######
if line =~ /\b(\w[-\w+.]*@\w[-\w.]+\w+)\b/i
m = line.scan(/(\w[-\w+.]*@\w[-\w.]+\w+)/i)
######

Replace them with the above lines in this answer, and the script will understand email addresses with hyphens in them too. The old script would fail for emails like bob-jones@example-domain.com. This new one likes them.

This isn't essential, I've just noticed it.
ChuckFickens
Fri 25/07/08
19:59
don't you wish that windows had grep!
fo3nix
Fri 25/07/08
20:51
Chuck: what I really wish for, is for Windows to come with Cygwin.
ACtheTROLL
Sat 26/07/08
12:07
fo3
bl@@dy excellent ....
I'm impressed (and a little humbled ;-)
Submit the above question and answers
 add to del.icio.us  add to digg  add to furl
 add to reddit  add to Technorati  add to Blinklist
 add to StumbleUpon  add to squidoo  add to ma.gnolia
 add to Cocomment  add to Netscape  add to Fark
about us | [Ctrl + D] adds us to bookmarks Switch to UK Net Guide You are in The AnswerBank  switch to UK Net Guide