Question

Delete duplicate emails in archive database

Asked by: WHLOW

Hi,

I used to have a few archive databases and it was merged into one through copy and paste.
Somehow thing went wrong and in my final merged archive database, for each email, I have four
other duplicate emails. So I ended up with like 24000 emails in "All Documents", where almost 70%
are duplicate emails.

An email is consider to be duplicate when the Sender, Date, Time and Subject are the same. Can anyone
provide me with a simple solution which I can perform to delete all the duplicate emails leaving only
the original? I'm basically an end-user with only a little bit of programming background, thus hopefully
the solution is straight-forward like running a program/script. If programming is involved, hopefully,
the solution is detailed with instructions.

Thank Folks!

Cheers.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2005-02-19 at 07:18:31ID21321258
Tags

delete

,

database

,

date

Topic

Lotus Notes

Participating Experts
2
Points
500
Comments
13

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. merge mail archives
    I'd like to merge the mail archives: a_ksmith1.nsf, a_ksmisth2.nsf, a_ksmith3.nsf into one file. The mail acrchives run between 800mb - 950mb and have been updated from an older r4.6/r5 DB format to the newer r6 DB format, I'm wondering what consolidation options exis...
  2. Opening archive problem
    Hi all, I have the following problem! I have used a archive policy to force mail archiving. When the users opens his maildatabase -> tools -> archive, the link to the archive database is there. The archive database is forced on a dedicated server (not on the mailserv...
  3. What's the best way to merge archives?
    I was asked to merge 2 archive databases. But I know from previous actions when I copied mails from one db to the other that it isn't as easy. If I copy mails from db1 All Documents and paste them into db2 All Documents then the mails appear there and the sent mails appear i...
  4. Merging Archive Files Outlook 2003
    Is there an easy way to merge Archive files without having the underling folders duplicate. Ex. Archive one Inbox subfolder A subfolder B Archive two Inbox subfolder A subfolder B Currently if I drag Inbox from Archive two into Archive One it will look like this Archive ...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: WHLOWPosted on 2005-02-22 at 01:47:34ID: 13370009

Can anyone direct me to where I should look at to solve this problem beside deleting the emails manually? :)

 

by: qwaleteePosted on 2005-02-22 at 18:58:16ID: 13378410

Create -> View
Name it SORT DUPS
Based on All Documents
Click CUSTOMIZE
For each of the columns EXCEPT the four you wish to use, delete the column, by clicking on teh column header, then presseing DELETE
For each of the remaining columns:
    Double clikc column header
    Choose second tab of properties
    Set it to sort ascending, using standard sort (not categorized).  You can leave alone everything else in the tab below that second line (standard/catgeorized)
Save and close the view

Now, we can write a script that processes this view, and deletes any line which is identical to the previous line.  Problem is, you really need Domino Designer to write the script.  Maybe, just maybe, we can get it to work in VBScript instead.

Backup your archive (in case this script blows up), create a text file called SORT DUPS.VBS, with the following content, then double-click its file icon when done:
Set s = CreateObject("Notes.NotesSession")
Set db = s.CreateDatabase("","") 'merely gets access to a "generic" Notes database
db.OpenMail 'switch genetic to mail
Set view = db.getView("SORT DUPS")
Set contents = view.AllEntries
Set row = contents.getFirstEntry
col1 = row.columnValues(0)
col2 = row.columnValues(1)
col3 = row.columnValues(2)
col4 = row.columnValues(3)
Set row = contents.getNextEntry(row)
Do Until row Is Nothing
    Set nextRow = contents.getNextEntry(row)

    If col1 = row.columnValues(0) And col2 = row.columnValues(1) And col3 = row.columnValues(2) And col4 = row.columnValues(3) Then
        row.document.remove
    Else
        col1 = row.columnValues(0)
        col2 = row.columnValues(1)
        col3 = row.columnValues(2)
        col4 = row.columnValues(3)
    End If
    Set row = nextRow
Loop

 

by: WHLOWPosted on 2005-02-22 at 22:02:02ID: 13379327

Thank qwaletee!

That's very helpful. Let me try to disgest the information first. I haven't create any view on Lotus Notes before nor writing VBScript. There's always a first time I suppose. Actually I happen to have access to one of the computer which has Domino Designer installed. I'll give your VBScript a test first, shouldn't let your effort go into waste without trying.

Will update you when I get to try the above later. Thank again.

Cheers.

 

by: WHLOWPosted on 2005-02-23 at 05:42:10ID: 13381990

Good news and Bad news. Good news - I managed to get the view working. Bad news - the VBScript doesn't work, return an error " Object doesn't support this property or method: 's.CreateDatabase' ".

Now I'm going through the help topics on the Lotus Notes application and see if I can using qwaletee vbscript solution as a guide to create an equivalent lotusscript. Wish me luck folks.

 

by: WHLOWPosted on 2005-02-23 at 08:42:15ID: 13384098

Spent a couple of hours looking at LotusScript. Quite a fair bit to learn. I can briefly understand the examples but just can't seem to get the program working. I can't seem to be able to find detailed information on the LotusScript programming methods too.

qwaletee or anyone else, if you are able to provide me the solution in LotusScript, I will be deeply appreciated as I can concentrate on my project work.

Thank Folks!

 

by: qwaleteePosted on 2005-02-23 at 19:00:13ID: 13389353

Should have been s.GetDatabase, my mistake.

I nly suggested VBScript because LotusScript requires you to have the Designer client installed.  The code woudl be identical in LotusScript except that:

    Set s = CreateObject("Notes.NotesSession")
becomes
    Dim s As New NotesSession

Plus, you can declare types for the other variables -- db As NotesDatabase, view as NotesView, contents as notesViewEntryCollection, row as notesViewEntry

 

by: WHLOWPosted on 2005-02-24 at 00:19:50ID: 13390467

Thank qwaletee.

I've tried the VBScript again and I ran into another error at line 5 "Object required: 'view' ".

Just to make sure I'm doing the correct stuffs, this is what I've done so far -

- Launch Lotus Notes and open my Archive database
- Created a SORT DUPS view in the Archive database
- Created a VBScript name SORTDUPS.VBS and saved it to C:\
- Double click on the SORTDUPS.VBS file icon in Windows Explorer at C:\

My question - I'm curious how is the VBScript able to connect and perform actions on the
archive if it's not running inside Lotus Notes. Did I miss out any pre-requirement or settings
that I have to check?

 

by: WHLOWPosted on 2005-02-24 at 00:41:38ID: 13390555

Another Qns,

I've tried creating the LotusScript based on qwaletee VBScript. The script is as below

Dim s As New NotesSession      
  Dim db As NotesDatabase
  Dim view As NotesView
  Dim contents As NotesViewEntryCollection
  Dim row As NotesViewEntry
  Dim nextRow As NotesViewEntry
      
  Set db = s.GetDatabase("","") 'merely gets access to a "generic" Notes database
  db.OpenMail 'switch genetic to mail
  Set view = db.getView("SORT DUPS")
  Set contents = view.AllEntries
  Set row = contents.getFirstEntry
  col1 = row.columnValues(0)
  col2 = row.columnValues(1)
  col3 = row.columnValues(2)
  col4 = row.columnValues(3)
  Set row = contents.getNextEntry(row)
  Do Until row Is Nothing
      Set nextRow = contents.getNextEntry(row)
            
      If col1 = row.columnValues(0) And col2 = row.columnValues(1) And col3 = row.columnValues(2) And col4 = row.columnValues(3) Then
          row.document.remove
     Else
         col1 = row.columnValues(0)
         col2 = row.columnValues(1)
         col3 = row.columnValues(2)
         col4 = row.columnValues(3)
     End If
     Set row = nextRow
Loop

But I face an error when trying to save the script. Error is "Missing arguement for: REMOVE"
The error is refering to "row.document.remove" if I'm not mistaken.

I've tried looking at the reference for NotesViewEntry which row is an instant of. The arguement should be
(Byval Force As Integer) which I'm not sure what I should subsitute in. I've tried (0), it allow me to save the script but I'm not sure if I'm doing the correct thing.

Lastly, where do I save this script in and how do I execute it.

Folks, thank for being patient with me. Especially qwaletee. Thank mate!

 

by: WHLOWPosted on 2005-02-24 at 01:25:13ID: 13390781

I've just manage to figure out how to run the script. I've created an agent and under Runtime, I've selected "Actions menu selection" and for trigger "On event" and for target "All documents in view".

 

by: WHLOWPosted on 2005-02-24 at 14:28:26ID: 13398029

My progress - I think i figure out why the row.document.remoe doesn't work, it need a arguement of either True or False.But even when i use row.document.remove(True), I encounter a "object variable not set" when I run the agent. Seem like the problem comes at  "Set contents = view.AllEntries" . Anyone got any clue?

 

by: WHLOWPosted on 2005-03-26 at 19:05:36ID: 13638067

I apologise for not closing the thread earlier.  Somehow I didn't manage to get the script running and just used the manual to delete all the duplicates one by one.  But again, like to thank qwaletee for his suggestions and codes, it does guide me towards the right direction.

 

by: makhanPosted on 2009-07-07 at 01:55:40ID: 24792477

Hi all,
I worked on the same requirement and now I came to this conclusion. The error message is because this view is not a part of collection of views returned by DB.views.

There is a slight code modification required to return the views in a db which I have done here is the code.

If this post is still alive then please move this forward.

The question un-answered is that why is our newly created view not showing as a part of DB.views

Code here
** this includes commented code as well which I am using for testing.
=====================================================
Sub Initialize
      Dim s As New NotesSession      
      Dim myv As NotesView
      Dim contents As NotesViewEntryCollection
      Dim row As NotesViewEntry
      Dim nextRow As NotesViewEntry
      Dim db As New NotesDatabase( "", "arc_mash_1.nsf" )
      If db.IsOpen Then
            Print  "The database arc_mash_1.nsf already open"
      End If
      
      Print db.filename
      ' status = db.Open("","arc_mash_1.nsf")  
      '
'      Set view = db.getView("SortByDuplicates")
      
      Print "====================================================="      
      
      Forall v In db.Views
            If v.name Like "*S*" And Not  v.name Like "GME*" Then
                  Print  v.name
            End If
      End Forall
      Print "====================================================="
'      Set myv = db.GetView("anyview")
'      Msgbox myv.Name
      
'      Set contents = view.AllEntries
'      Set row = contents.getFirstEntry
'      col1 = row.columnValues(0)
'      col2 = row.columnValues(1)
'      col3 = row.columnValues(2)
'      col4 = row.columnValues(3)
'      Set row = contents.getNextEntry(row)
'      Do Until row Is Nothing
'            Set nextRow = contents.getNextEntry(row)
'            If col1 = row.columnValues(0) And col2 = row.columnValues(1) And col3 = row.columnValues(2) And col4 = row.columnValues(3) And col5 = row.columnValues(4) Then
'                  row.document.delete
'            Else
'                  col1 = row.columnValues(0)
'                  col2 = row.columnValues(1)
'                  col3 = row.columnValues(2)
'                  col4 = row.columnValues(3)
'                  col5 = row.columnValues(4)            
'            End If
'            Set row = nextRow
'      Loop
End Sub
===========================================================

 

by: makhanPosted on 2009-07-07 at 06:14:30ID: 24793873

Hi all,

my new updated script which runs without any errors but does not do the deletion thing.

Sub Initialize
      Dim s As New NotesSession      
      Dim myv As NotesView
      Dim contents As NotesViewEntryCollection
      Dim maksrow As NotesViewEntry
      Dim nextRow As NotesViewEntry
      Dim db As New NotesDatabase( "", "C:\notes\data\archive\arc_mash_2008.nsf" )
      Dim mydelrow As NotesViewEntry
      
      ' Set db = s.GetDatabase("","C:\notes\data\archive\arc_mash_2008.nsf")
      If db.IsOpen Then
            Print  "The database arc_mash_2008.nsf already open"
      Else
            db.OpenMail
      End If
      
      Print db.filename
      '
      '
      
      Print "====================================================="      
      
      Forall v In db.Views
            If v.name = "Sort for Deletion" Then
                  Print  v.name
            End If
      End Forall
      Print "====================================================="
      Set myv = db.getView("Sort For Deletion")
      Msgbox myv.Name
      
      Set contents = myv.AllEntries
      Set maksrow = contents.getFirstEntry
      col1 = maksrow.columnValues(0)
      col2 = maksrow.columnValues(1)
      col3 = maksrow.columnValues(2)
      col4 = maksrow.columnValues(3)
      col5 = maksrow.columnValues(4)
      Set maksrow = contents.getNextEntry(maksrow)
      myv.Clear
      Do Until maksrow Is Nothing
            Set nextRow = contents.getNextEntry(maksrow)
            myrow = myrow + 1
            If col1 = maksrow.columnValues(0) And col2 = maksrow.columnValues(1) And col3 = maksrow.columnValues(2) And col4 = maksrow.columnValues(3)  Then
                  ' And col5 = maksrow.columnValues(4)
                  Print "deleting "
                  Print maksrow.ColumnValues(0)
                  Print maksrow.ColumnValues(1)
                  Print maksrow.ColumnValues(2)
                  Print maksrow.ColumnValues(3)
                  ' Print maksrow.ColumnValues(4)      
                  Call contents.DeleteEntry(maksrow)
            Else
                  col1 = maksrow.columnValues(0)
                  col2 = maksrow.columnValues(1)
                  col3 = maksrow.columnValues(2)
                  col4 = maksrow.columnValues(3)
                  ' col5 = maksrow.columnValues(4)            
            End If
            Set maksrow = nextRow
      Loop
End Sub

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...