Menu

Merge two GEDCOM files

janpolsen
2010-03-18
2013-05-30
  • janpolsen

    janpolsen - 2010-03-18

    As I understand from the small experience I have with PGV's merging feature, then it can only merge single records.

    If that is correct how do you then add a new segment (B) (GEDCOM file) to an existing GEDCOM (A), when you want to keep the IDs of (A) intact? Is there any thirds party software/tool to ease this task?

    Segment B is too large to add all records individually.

     
  • falcybe

    falcybe - 2010-03-19

    Look in Tracker/Feature Requests and type merge gedcom into the search box. You should come to artifact ID 1581206. There is even a patch for merging two gedcoms here, with 7 versions. Have a look to see if it is what you want.

     
  • janpolsen

    janpolsen - 2010-03-19

    Thank you very much for pointing me in that direction… I will take a look at it right away :).

     
  • janpolsen

    janpolsen - 2010-03-19

    Darn…. It seems that that script doesn't work anymore :(

     
  • ggpauly

    ggpauly - 2010-03-23

    I've used gramps for this, but there are some gotchas: esp. gramps doesn't use udf8 encoding, which breaks special characters.

    GDBI has an experimental facility for this - see  http://gdbi.sourceforge.net/merge.html.  If I were going to merge a Gedcom to my existing database I'd look into this.

     
  • janpolsen

    janpolsen - 2010-03-23

    Thanks for your input gpauly, but unfortunately GDBI doesn't work with phpGedView 4.2.3, so that is out of the question :(.

    I have also tried Gramps, but without much success. I didn't know that it couldn't handle UTF8 encoding, but knowing that now, certainly will put it out of the picture, as I have lots of danish characters.

     
  • Julio Sánchez Fernández

    Try artifact 2975749 (https://sourceforge.net/tracker/?func=detail&aid=2975749&group_id=55456&atid=477081)

    It is my private copy and is patched according to my tastes.  I would not have sent this if it was not apparent that this has been abandoned..

    Be very careful with it, I have not done much serious use of it lately.

     
  • janpolsen

    janpolsen - 2010-03-24

    I have tried it, but it gives me some errors :(

     
  • Julio Sánchez Fernández

    You wouldn't mind sharing with us what those errors are?  What PGV version are you running?

     
  • janpolsen

    janpolsen - 2010-03-24

    I posted the errors and the version info under you artifact

     
  • Stephen Arnold

    Stephen Arnold - 2010-03-25

    Jan
    I'll be happy to use my copy of GEDITCOM to merge your GEDCOMs. Please advise which is the 'master' as it will not be renumbered, while the merged GEDCOM will change. email to gedcoms at myarnolds dot com

    stephen

     
  • Julio Sánchez Fernández

    I wonder if it is related to http://bugs.php.net/bug.php?id=35793

    Can you try to set $statement to null before the database call at line 209?  It would read like this:

    // Locate the SOUR record in the target GEDCOM
      $xref1 = "";
      // See http://bugs.php.net/bug.php?id=35793
      $statement = null;
      $statement=PGV_DB::prepare("SELECT s_id FROM ".$TBLPREFIX."sources WHERE s_file=? AND s_name = ?")->execute(array(get_id_from_gedcom($ged1),$source_title));
      while($row = $statement->fetch(PDO::FETCH_ASSOC)) {

    Does it work now?

    Julio

     
  • janpolsen

    janpolsen - 2010-03-25

    @stephen: I thank you for that nice offer, but I'm afraid this isn't a one-time-only. I was hoping to expand my tree with segments I find around the net, so it would be best if I could do it myself :(.

    @jsanchez: That helped some… but other errors occur and I don't really know if that is because of the source code or maybe a problem with the GED-file.

    The following is a snippet where the errors occur:

    Look for records that need matching up or importing
    ERROR 8: Undefined index: F506
    0 Error occurred on line 631 of file gedmerge.php
    ERROR 8: Undefined offset: 1
    0 Error occurred on line 82 of file gedmerge.php in function simple_gedrec
    1 called from line 631 of file gedmerge.php
    ERROR 8: Undefined offset: 1
    0 Error occurred on line 62 of file gedmerge.php in function url_of_object
    1 called from line 90 of file gedmerge.php in function simple_gedrec
    2 called from line 631 of file gedmerge.php
    ERROR 8: Undefined index: F506
    0 Error occurred on line 635 of file gedmerge.php
    ERROR 8: Undefined index: F506
    0 Error occurred on line 639 of file gedmerge.php
    

    The last two errors (with line 635 and 639) showed up lots of times.

     
  • Julio Sánchez Fernández

    Then setting $statement to null workarounds the problem.

    The other problem is possibly that your GEDCOM does not have a F506 family.  This may be caused by letting edit_merge.php import FAMC, FAMS or CHIL links.

    Or it may be caused by a problem in gedmerge.  In the old times, setting the global $GEDCOM changed the active GEDCOM.  Now that is not so easy and gedmerge gets easily confused.  Make sure the destination GEDCOM is the active GEDCOM before using gedmerge.  I don't know how to fix this problem.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.