Merge Records Option

31 views
Skip to first unread message

Jay Fletcher

unread,
Oct 2, 2024, 5:10:03 PM10/2/24
to GEDitCOM II Discussions
It would be nice if there was an option when using the Merge Records script to run in a mode in which records are automatically merged if the matching score is 100 and not matched if the score is less than 100 (i.e. without being prompted). This comes up a lot after merging GEDCOMs that come from the same source. In particular, sources and places are often duplicated exactly. It would be similar to the option to merge notes with duplicate text. What would it take to add this option to essentially merge only exact duplicate records automatically without being prompted?

Thank you,
Jay

John Nairn, Developer

unread,
Oct 16, 2024, 12:12:53 PM10/16/24
to GEDitCOM II Discussions
You can if you want and easy to try. It can be hard for code to identify all records that should merge, but if you are confident you want to merge above some score (say 95), then insert this code:

            if merit < 95. :
                choice = GetOption(prompt,msg,["Don't Merge","Merge","Cancel"])
            else :
                choice = "Merge"

To insert it, open the MergeRecords.gplug extension in GEDitCOM Editor (an easy way is to select Editing Tools->Merge Records in GEDitCOM II while holding down the option key). In GEDitCOM Editor, expand the Scripts section and click on "Find and Merge Duplicates.py" (the first one). Scroll down to nearly the bottom to find section beginning in "if merit > 0. :" (easy way is to use Find command and search for "if merit > 0"). 11 lines before that line is a line beginning in "choice = GetOption(...". Replace that line with the code above. This will prompt you only if merit is below the number you enter (above is 95). If equal or above that score, the merge will happen without prompting. If you are not used to Python programming, it is very finicky about indents. I tried to give correct indents in above snippet. When done, the above "if" and "else" lines should be indented same as line above it while the two choice lines should be indented 4 spaces.

Merging is a challenging topic. You can try different cutoffs and check the results. If you are getting GEDCOMs from other sources, this script is be best hope for semi-automating merging. If all files were created in GEDitCOM II, you may be able to do automatic merging with no prompts by using UUIDs. The help explains how to use UUIDs and importantly what is needed for that method to be available.

John Nairn

Jay Fletcher

unread,
Oct 16, 2024, 6:40:40 PM10/16/24
to GEDitCOM II Discussions
Hi John,

Thank you for your detailed response. I created my own version of the MergeRecords.gplug as a user extension, and I made very similar changes to what you suggested. Your approach is more elegant, so I will go back and implement what you have suggested instead. This has been working well for me.

I am downloading GEDCOM files for some of my DNA cousins from the GRanDMA Online Mennonite database and then piecing them back together using GEDitCOM II. I can't use UUIDs, but since I am downloading pieces of a huge tree from a database, I can expect that the duplicates (overlapping parts of the trees) will be almost identical. Having a semi-automated way to merge the duplicate records is very helpful.

Just to be extra careful, I only use the automated process to merge sources and places. I still merge individuals and families manually because either my copy or the database copy of a person or family may have evolved slightly between merges.

Another option that would be very helpful is to be able to specify an album of people to consider when using the MergeRecords extension. When I merge the records from a new GEDCOM into my family tree in GEDitCOM II a "Merged" album is created. Only people in this album could be duplicates in this scenario. However, the MergeRecords extension is set up to check all of the individuals in the unified GEDCOM (a starting point can be selected). It would be much more efficient if I could specify that only the people in the "Merged" album be checked as potential duplicates. I would be happy to implement this if you can give me some hints/pointers like you did above.

Thank you,
Jay

Reply all
Reply to author
Forward
0 new messages