anyone have a good script to run through a mysql db and remove duplicate(but
leave 1) and improper emails?
tia
~Dave the disruptor~
google will pay you money to getting rid of ie :)
http://explorerdestroyer.com/
http://www.killbillsbrowser.com/
dave wrote:
anyone have a good script to run through a mysql db and remove duplicate(but
leave 1) and improper emails?
That would totally depend on your database design =)
Rick
~|
Message:
, February 02, 2006 3:15 PM
To: CF-Talk cf-talk@houseoffusion.com
Subject: Re: db eamil cleaner
dave wrote:
anyone have a good script to run through a mysql db and remove duplicate(but
leave 1) and improper emails?
That would totally depend on your database design =)
Rick
that helps.
John Burns
Certified Advanced ColdFusion MX Developer
Wyle Laboratories, Inc. | Web Developer
-Original Message-
From: dave [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 02, 2006 3:18 PM
To: CF-Talk
Subject: Re: db eamil cleaner
really only 2 fields: id (primary
And on that email validating regex, does anyone have a better one than:
^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)[EMAIL PROTECTED](\.[a-zA-Z0-9-]+)*\.(([0-9]{
1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$
?
~|
Message:
: db eamil cleaner
I don't have a script but the basic idea would look like this:
Select distinct email addresses and the id with it. Then delete all
records whose ID is not in that list. Then, I'd use a regex to loop over
the emails, compare them to the regex and if it's not valid, delete
://explorerdestroyer.com/
http://www.killbillsbrowser.com/
From: Burns, John D [EMAIL PROTECTED]
Sent: Thursday, February 02, 2006 3:25 PM
To: CF-Talk cf-talk@houseoffusion.com
Subject: RE: db eamil cleaner
I don't have a script but the basic idea would look like
, February 02, 2006 3:25 PM
To: CF-Talk cf-talk@houseoffusion.com
Subject: RE: db eamil cleaner
I don't have a script but the basic idea would look like this:
Select distinct email addresses and the id with it. Then delete all
records whose ID is not in that list. Then, I'd use a regex
Select emailAddress from emails group by emailAddress having
count(emailAddress) 1
And then do whatever you need to do with these ids...
-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 02, 2006 3:52 PM
To: CF-Talk
Subject: Re: db eamil cleaner
://explorerdestroyer.com/
http://www.killbillsbrowser.com/
From: Russ [EMAIL PROTECTED]
Sent: Thursday, February 02, 2006 4:04 PM
To: CF-Talk cf-talk@houseoffusion.com
Subject: RE: db eamil cleaner
Select emailAddress from emails group by emailAddress having
count
: Thursday, February 02, 2006 3:45 PM
To: CF-Talk
Subject: RE: db eamil cleaner
The problem with that is when you use distinct and then add the ID field
it no longer grabs only one email because the id field is a distinct
number as well so you get all the records back not just one of each.
~Dave
-Talk
Subject: RE: db eamil cleaner
Select emailAddress from emails group by emailAddress having
count(emailAddress) 1
And then do whatever you need to do with these ids...
-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 02, 2006 3:52 PM
To: CF-Talk
, February 02, 2006 4:04 PM
To: CF-Talk cf-talk@houseoffusion.com
Subject: RE: db eamil cleaner
Select emailAddress from emails group by emailAddress having
count(emailAddress) 1
And then do whatever you need to do with these ids...
-Original Message-
From: Ben Doom [mailto:[EMAIL
And on that email validating regex, does anyone have a better one than:
^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)[EMAIL PROTECTED](\.[a-zA-Z0-9-]+)*\.(([0-9]{
1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$
What's wrong with:
isValid(email, myQUERY.myEMAIL)
??
How about just this:
SELECT email, MIN(id)
FROM table
GROUP BY email
cheers,
barneyb
On 2/2/06, dave [EMAIL PROTECTED] wrote:
anyone have a good script to run through a mysql db and remove duplicate(but
leave 1) and improper emails?
tia
~Dave the disruptor~
--
Barney Boisvert
[EMAIL
/
http://www.killbillsbrowser.com/
From: Mike Klostermeyer [EMAIL PROTECTED]
Sent: Thursday, February 02, 2006 4:49 PM
To: CF-Talk cf-talk@houseoffusion.com
Subject: RE: db eamil cleaner
This will give you the emails in question, but it doesn't give you
: RE: db eamil cleaner
This will give you the emails in question, but it doesn't give you the ID's
that you need in order to remove them safely. Ben's idea of joining the
table to itself (earlier post):
select id from emails as a, emails as b where a.id b.id and a.email =
b.email
Because we have a mixed cf5/cfmx7 environment?
Because I was ignorant of the isValid(email) function?
Good stuff, though. Thanks.
Does anyone know how exact the test is? This doesn't give me quite enough info:
Valid address characters are a-zA-Z0-9_- and the period and separator.
There must be
: Ben Doom [EMAIL PROTECTED]
Sent: Thursday, February 02, 2006 5:23 PM
To: CF-Talk cf-talk@houseoffusion.com
Subject: Re: db eamil cleaner
Pay my way to CFUN and I'll sing any song you want, my man.
--ben
dave wrote:
well thats cause ben is a STUD in a ted nugent kinda way ;)
can u see ben up
19 matches
Mail list logo