开发者

I have two lists of e-mail addresses that I paste into outlook. How can I remove duplicates?

Some software I use generates a list of e-mail addresses based on some criteria, but some people have multiple criteria, so I end up with two big lists of addresses with some duplicate entries. What's the easiest way to remove the duplicates, so users don't receive two emails?

To clarify:

I want to e-mail all people who are aged 50 or over, or like c开发者_如何转开发ats.

I run a query for 50+ people, and copy their emails into outlook, then I run a query for people who like cats and paste those in. People who are over 50 and like cats end up coming up in both searches and get their email pasted in twice...


You could copy the lists of addresses to two text files, and then:

(cat over50.txt likecats.txt) | sort | uniq >over50andlikecats.txt


To be honest, this doesn't really sounds like much of a programming problem, but if it were then you've got a code-based approach

  1. Grab the two lists into arrays
  2. merge the arrays
  3. remove duplicates
  4. Use this list

or a database-based approach

  1. Insert each list into a database table
  2. Do a select distinct
  3. Now paste the results into Outlook.


If you use .NET or Java (or any language that has collections or lists), you can do the following:

create a collection object

for each list
   for each item
      check to see if that email exists in the collection already
      if not
          add it into the list
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜