Splitting GEDCOMs With GRAMPS - A Guide

+7 votes
598 views

One question we see quite a bit is "how do I split a GEDCOM?" I've mentioned before that I split chunks off my family tree and create GEDCOMs often using the free open source genealogy program GRAMPS. I made the offhand comment that I should write up a guide, L J Russell  gave me a little nudge, I set to work, and 12 days later I brought forth said document. It's more a booklet than a quick start guide. I tried to write it so the "least experienced with computers" person could follow it and learn from it. I formerly worked tech support, specifically application support, so I guess readers will both benefit from and suffer from my experience.

I also have a secret agenda of promoting more thoughtful use of GEDCOMs with WikiTree :) This is version 1.0. I'll keep poking at it and improving it. I keep switching between first, second, and third person for no good reason. I'll be fixing that, and other crimes to Funk and Wagnall.

Link: Space:Splitting_GEDCOMs_With_GRAMPS

in The Tree House by Dave Ebaugh G2G6 Mach 2 (21.2k points)
recategorized by Dave Ebaugh
I meant for this to post in The Tree House. Could an Admin move it?

YAY DAVE.. Thank you so much!!!

You can Edit your original Post and choose Tree House under recategorize.

So I just use the completely obvious solution that I totally missed to change the category?

I really did work in tech support. Problem is, I can't turn WikiTree off and then on again. (I'm joking through the pain.) :)

2 Answers

+3 votes

As a user of GRAMPS  just wanted to thank you for putting this together.

Only problem I have with transferring my wikitree Gedcom to GRAMPS is "middle names", GRAMPS doesn't seem to like  the Wikitree Gedcom format used ... it doesn't pick them up  ... does the error thingy for them.. and I end up with people with no middle names....Have you come across that problem ?

This is an example of Wikitree Gedcom with a middle name : 

1 NAME Noel Lee /Angwin/

2 GIVN Noel

2 _MIDN Lee

2 SURN Angwin

and this is a GRAMPS GEDCOM

1 NAME Noel Lee /Angwin/

2 GIVN Noel Lee

2 SURN Angwin

Do you know how to get GRAMPS to recognise the "_MIDN  " that the Wikitree Gedcom generates. 

by Lesley Robertson G2G6 Mach 2 (20.6k points)

I've never tried going in that direction. TBH, I didn't know it was possible before you mentioned it.

I do have an idea of how to fix the problem. It involves preprocessing the WikiTree generated GEDCOM. The rub is deploying said solution. What OS are you running? That will determine how we can proceed.

GEDCOMs are plain text files. It looks like WikiuTree GEDCOMs retain the NAME field in it's entirety, so it's really just the matter of a quick search-and-replace to remake it so it looks like GRAMPS style. For this we utilize the dark art of the register expression. These mystic utterances do the work. (I'm not sure how familiar you are with computer science. If you know about regexs, you will certainly appreciate calling them a "dark art.")

Oooooh ...

I just discovered deployment will be easier than I thought.

I'm excited. :)

Boo Yah!

I wrote regexs that worked the first second time! That rarely happens.

For the record for interested parties the regex to match is (GIVN (.*)?[\r\n](2 _MIDN (.*)?\n))

The regex to do the replacement is GIVN \2 \4\n

I tested it with Kate, a text editor that has an option to use regular expressions in search and replace functions. Here's one chunk from the file I downloaded from WikiTree:

0 @I6@ INDI
1 NAME Edwin Lewis /Ebaugh/
2 GIVN Edwin
2 _MIDN Lewis
2 SURN Ebaugh
1 SEX M

Same chunk, after processing:

0 @I6@ INDI
1 NAME Edwin Lewis /Ebaugh/
2 GIVN Edwin Lewis
2 SURN Ebaugh
1 SEX M
1 BIRT

On Windows you can do this with Notepad++, which I think is preinstalled? Load a copy of the WikiTree GEDCOM into Notepad++. Bring up the Replace dialog box (Ctrl+H) and select the Regular Expression search mode.
Find what: (GIVN (.*)?[\r\n](2 _MIDN (.*)?\n))
Replace with: GIVN \2 \4\n

You might need to replace with GIVN \2 \4\r\n on Windows because Windows is weird.

Macs I don't know. It seems like something would be easily available, but I haven't paid attention to that world since last century. (Late 90s :) )

See what I was talking about dark arts?

Dave

It certainly is a little bit techo for me... but I will sure give it my best shot in notepad/widows

Many thanks Dave for looking into for me... Greatly appreciated...

Lesley

"GRAMPS doesn't seem to like  the Wikitree Gedcom format used"

That's because WikiTree is exporting an invalid GEDCOM tag: _MIDN. The GEDCOM data model has no "middle name" item, only NAME and GIVN ones.

The concept (without any formal definition!) of "middle name" is an AngloSaxon one, in WikiTree forced on other cultures too. Like on importing a Gedcom where WikiTree automatically splits multiple words in GIVN in the first one to go to Proper First Name and the remaining one(s) to Middle Name.

On exporting WikiTree should keep the international Gedcom standard and concatenate PFN and Middle Name in the GIVN item. That would make Dave's postprocessing operation unnecessary.

Jan,

That's interesting... Wonder why Wikitree decided not to use international Gedcom Standards...

Dave,

Your work around worked a treat ... yes

The only ones it didn't pick up were ones that had the following : [ PGVN ] , 

NAME Maggie McIntyre /Henderson/

2 GIVN Maggie

2 _PGVN Margaret

2 _MIDN McIntyre

2 SURN Henderson

That was ok, there was only about 5 of them, so I did those ones manually....

Thank you 

+2 votes
Thanks for this! Have been wondering how I can spit my gedcoms!
by Anonymous Behrens G2G1 (1.5k points)

Related questions

+7 votes
3 answers
333 views asked Aug 29, 2020 in WikiTree Help by Dave Sellers G2G6 Mach 4 (49.8k points)
+3 votes
2 answers
188 views asked Jul 19, 2023 in WikiTree Tech by Chris Strickland G2G6 (8.7k points)
+4 votes
0 answers
255 views asked Jul 13, 2018 in WikiTree Help by Craig Treleaven G2G Crew (630 points)
+4 votes
1 answer
+3 votes
1 answer
220 views asked Jan 17, 2019 in The Tree House by Living McCormick G2G6 Mach 6 (60.0k points)
+4 votes
2 answers
+10 votes
5 answers
1.0k views asked May 14, 2016 in The Tree House by Yvonne Butler G2G3 (3.8k points)
+6 votes
2 answers
356 views asked May 19, 2020 in The Tree House by Dave Ebaugh G2G6 Mach 2 (21.2k points)
+7 votes
1 answer
228 views asked Feb 22, 2016 in WikiTree Tech by Marnie Hall G2G3 (3.8k points)

WikiTree  ~  About  ~  Help Help  ~  Search Person Search  ~  Surname:

disclaimer - terms - copyright

...