SV650.org - SV650 & Gladius 650 Forum



Idle Banter For non SV and non bike related chat (and the odd bit of humour - but if any post isn't suitable it'll get deleted real quick).
There's also a "U" rating so please respect this. Newbies can also say "hello" here too.

Reply
 
Thread Tools
Old 21-08-09, 12:01 PM   #1
slloyd
Guest
 
Posts: n/a
Default Deleting duplicate email addresses from a database

We have a very small DB with 15K rows made up of email addresses for mailshots, and have another spreadsheet with 3K rows
of unsubscribed requests, with email addresses included.

I want to be able to strip this information from the main DB, thus not sending a mailshot to those who have requested not to receive this information.

Does anyone have any code, formula, script or CSV parser to carry out such command.

As I have opened the files in excel, I've been looking at VLOOKUP but can't get my head around.

thanks in advance.
  Reply With Quote
Old 21-08-09, 12:28 PM   #2
Baph
Guest
 
Posts: n/a
Default Re: Deleting duplicate email addresses from a database

My advice, would be to add a column in the DB to allow each row to specify mailshot preferences, lets call it "allowMailShot" for now, with a boolean value.

Then you just run:
SELECT mailAddr FROM table WHERE allowMailShot=1;

Importing the data from CSV should be pretty simple, even if it's an MSAccess "database."

HTH.
  Reply With Quote
Old 21-08-09, 02:12 PM   #3
ooger
Guest
 
Posts: n/a
Default Re: Deleting duplicate email addresses from a database

Ah, the MS office solution:

If you've opened them in Excel and are having a can't be *rsed Friday afternoon (and can reimport back to the db) assuming you don't want to use SQL:

Make column A the values from the 15K rows
Make column B the formula =MATCH(A1,C:C,0)
Make column C the 3K unsubscribed peoples emails.

Copy and paste row B down to as many rows as column C has

On any row the number displayed in column B indicates on which row that email address is found in column A, if it is found - therefore, convert all formulas to their text results, replace all blanks in column B with zeroes , sort the range A,B,C by column B and the values that are >=1 are the matches where an unsubscribed email is in the 15K list - delete them and reimport.


Failing that, write the lot in Lotus Notes and be done with it!
  Reply With Quote
Old 21-08-09, 03:30 PM   #4
Kinvig
Guest
 
Posts: n/a
Default Re: Deleting duplicate email addresses from a database

SELECT DISTINCT EMAILADDRESS FROM TABLE

will do it.
  Reply With Quote
Old 21-08-09, 03:44 PM   #5
slloyd
Guest
 
Posts: n/a
Default Re: Deleting duplicate email addresses from a database

[QUOTE=ooger;2011808]Ah, the MS office solution:

If you've opened them in Excel and are having a can't be *rsed Friday afternoon (and can reimport back to the db) assuming you don't want to use SQL:
QUOTE]

Ooger thanks for this, you must know my Friday afternoon antics.

Defo, especially after 2hrs of Friday lunchtime watering hole ventures

Anyway, managed to the numbered results in column B but a few are reporting back as #N/A is this correct? or does this mean no matches found.

Now need to do the following but not sure how to:

convert all formulas to their text results, replace all blanks in column B with zeroes , sort the range A,B,C by column B and the values that are >=1 are the matches where an unsubscribed email is in the 15K list - delete them and reimport
  Reply With Quote
Old 21-08-09, 03:46 PM   #6
slloyd
Guest
 
Posts: n/a
Default Re: Deleting duplicate email addresses from a database

Baph & Kinvig, thanks for your input and advice but right now my SQL knowledge and workings are a little rusty so the Excel option seems like the one for me, especially on a Friday afternoon - when I wanted to spend my time looking for a replacement end can
  Reply With Quote
Old 21-08-09, 03:48 PM   #7
Kinvig
Guest
 
Posts: n/a
Default Re: Deleting duplicate email addresses from a database

what format's the data in at the moment?
  Reply With Quote
Old 21-08-09, 03:50 PM   #8
ooger
Guest
 
Posts: n/a
Default Re: Deleting duplicate email addresses from a database

#n/a means no matches found for the MATCH formlua, its fine as long as you can identify them as being seperate. I'd replace them with zeroes though cos itll make the sorting better.

Now you've done that select all, and choose copy, the select all and choose "Paste Special" and past the VALUES of the calcs only into the sheet ontop of whats there already. That removes the formulas, then you can begin sorting and deleting without worrying about it trying to recalc the lot as you work.

HTH
  Reply With Quote
Old 21-08-09, 03:51 PM   #9
ooger
Guest
 
Posts: n/a
Default Re: Deleting duplicate email addresses from a database

Quote:
Originally Posted by Kinvig View Post
what format's the data in at the moment?

Courier New, size 14. Why?


  Reply With Quote
Old 21-08-09, 03:54 PM   #10
slloyd
Guest
 
Posts: n/a
Default Re: Deleting duplicate email addresses from a database

CSV sitting in Excel 2007
  Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate M.O.T. certificate,s stewie Idle Banter 2 12-03-08 07:34 AM
Unfortunate web addresses cuffy Idle Banter 6 26-07-06 08:28 PM
duplicate - deleted Captain Nemo Bikes - Talk & Issues 1 07-03-05 11:55 AM


All times are GMT. The time now is 03:47 PM.


Powered by vBulletin® - Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.