What is GEDCOM?

GEDCOM (an acronym standing for Genealogical Data Communication) is an open de facto specification for exchanging genealogical data between different genealogy software. GEDCOM was developed by The Church of Jesus Christ of Latter-day Saints (LDS Church) as an aid to genealogical research.

More on Wikipedia.

About structure

A GEDCOM file consists of a header section, records, and a trailer section. Within these sections, records represent people (INDI record), families (FAM records), sources of information (SOUR records), and other miscellaneous records, including notes. Every line of a GEDCOM file begins with a level number where all top-level records (HEAD, TRLR, SUBN, and each INDI, FAM, OBJE, NOTE, REPO, SOUR, and SUBM) begin with a line with level 0, while other level numbers are positive integers.

Example

The following is a sample GEDCOM file contains families of the Lincolns. The first column indicates an indentation level.

The header (HEAD) includes the source program and version (Ancestry.com, 2010.3), the GEDCOM version (5.5), and the character encoding (UTF-8), as according to the GEDCOM 5.5 specification; valid choices are ANSEL, UNICODE or ASCII.

The individual records (INDI) define Sarah (ID @I1@), Sarah Evans (ID @I2@), Rebecca Flowers (ID @I3@ etc, etc.).

The family record (FAM) links the husband (HUSB), wife (WIFE), and child (CHIL) by their ID numbers.

The GedCom Parser JavaScript Library

A simple GEDCOM parser that focuses on translating GEDCOM structure into a GedCom Library.

Tested with GEDCOM 5.5 exported from Ancestry.com.

Buy at Codecanyon.

Initialization

Load a GEDCOM file into GedCom Parser.

See the complete Documentation

<script src='GedCom.js'></script>
<script type="text/javascript">
	var gedcom = new GedCom("./LincolnFamily.ged", function(instance){
		//Do something when GedCom Parser is ready
	});
	//or
	var gedcom = new GedCom("./LincolnFamily.ged", {
		start: function(filename, content){
			//Do something when GEDCOM file parsing is started
		},
		done: function(instance){
			//Do something when GedCom Parser is ready
		},
		error: function(error){
			//Do something when GEDCOM file parsing is not completed
		},
		progress: function(percent){
			//Do something while GEDCOM file is parsing
		}
	});
</script>

Get a record

Get an Individual

<script type="text/javascript">
	var gedcom = new GedCom("./LincolnFamily.ged", function(instance){
		var indi = instance.getIndividuals().get('@I1@');
		//or
		var indi = instance.getIndividuals('@I1@');
	});
</script>

Get a Family

<script type="text/javascript">
	var gedcom = new GedCom("./LincolnFamily.ged", function(instance){
		var fam = instance.getFamilies().get('@F1@');
		//or
		var fam = instance.getFamilies('@F1@');
	});
</script>

Get relatives of an Individual

<script type="text/javascript">
	var gedcom = new GedCom("./LincolnFamily.ged", function(instance){
		var indi = instance.getFamilies().get('@I1@');
	
		if( indi != undefined )
		{
			var siblings = indi.getSiblings();
			var parents = indi.getParents();
			var children = indi.getChildren();
			//etc there are a lot of methods to get all types of relatives.
			//See the complete Documentation on http://gedcom.idavid.hu/Doc		
		}
	});
</script>

Live preview