RootsWeb.com Mailing Lists
Total: 1/1
    1. Re: Using AWK to manipulate GEDCOM files
    2. On Tuesday, February 19, 2013 3:14:52 AM UTC-6, Steve Hayes wrote: > In an earlier message I suggested using AWK to manipulate a GEDCOM file to > > solve a particular problem. > > > > That point tended to get lost in discussion of other points like using other > > ways to solve the problem, or discussion of flaws in the GEDCOM data model > > itself and proposals for its replacement, which I see as a separate question. > > > > What I would like to see is the development of a kind of library of AWK > > routines to manipulate GEDCOM files. Lots of genealogists have GEDCOM files, > > and some would like to make changes to them, or extract information from them > > in ways that might not be possible with other genealogy programs. > > > > Here is a GEDCOM file. > > > > I tried to choose a short one to use as an example, which shows the structure > > of the file. > > > > 0 HEAD > > 1 SOUR ANSTFILE > > 2 VERS 4.19 > > 2 NAME Ancestral File (R) > > 2 CORP The Church of Jesus Christ of Latter-day Saints > > 3 ADDR 50 East North Temple Street > > 4 CONT Salt Lake City, Utah 84150 > > 2 DATA Ancestral File > > 3 DATE 5 January 1998 > > 3 COPR Copyright (c) 1987, June 1998 > > 1 DEST PAF > > 1 DATE 20 APR 2002 > > 2 TIME 2:58:56 > > 1 FILE GEDCOM4.ged > > 1 GEDC > > 2 VERS 5.5 > > 2 FORM LINEAGE-LINKED > > 1 CHAR ANSEL > > 1 SUBM @SUB01@ > > 1 SUBN @N01@ > > 0 @SUB01@ SUBM > > 1 NAME Created by FamilySearch (TM) Internet Genealogy Service > > 1 ADDR 50 East North Temple Street > > 2 CONT Salt Lake City, Utah 84150 > > 0 @S01@ SOUR > > 1 AUTH The Church of Jesus Christ of Latter-day Saints > > 1 TITL Ancestral File (R) > > 1 PUBL Copyright (c) 1987, June 1998, data as of 5 January 1998 > > 1 REPO @R01@ > > 0 @R01@ REPO > > 1 NAME Family History Library > > 1 ADDR 35 N West Temple Street > > 2 CONT Salt Lake City, Utah 84150 USA > > 0 @N01@ SUBN > > 1 DESC 2 > > 1 ORDI N > > 0 @I3GLR-Z3@ INDI > > 1 NAME Thomas William /BALDOCK/ > > 2 GIVN Thomas William > > 2 SURN BALDOCK > > 1 AFN 3GLR-Z3 > > 1 SEX M > > 1 SOUR @S01@ > > 1 BIRT > > 2 DATE 1 Jul 1850 > > 2 PLAC Geelong, Vic, Astl > > 1 FAMS @F1794078@ > > 1 FAMC @F524078@ > > 0 @I3GLR-4R@ INDI > > 1 NAME Thomas /BALDOCK/ > > 2 GIVN Thomas > > 2 SURN BALDOCK > > 1 AFN 3GLR-4R > > 1 SEX M > > 1 SOUR @S01@ > > 1 FAMS @F524078@ > > 0 @I3GLR-5X@ INDI > > 1 NAME Anne /CHAMBERS/ > > 2 GIVN Anne > > 2 SURN CHAMBERS > > 1 AFN 3GLR-5X > > 1 SEX F > > 1 SOUR @S01@ > > 1 FAMS @F524078@ > > 0 @I98BW-JC@ INDI > > 1 NAME Emily Jane /THORNTON/ > > 2 GIVN Emily Jane > > 2 SURN THORNTON > > 1 AFN 98BW-JC > > 1 SEX F > > 1 SOUR @S01@ > > 1 BIRT > > 2 DATE 1854 > > 2 PLAC Geelong, Victoria, Australia > > 1 DEAT > > 2 DATE 9 Dec 1890 > > 2 PLAC Geelong, Victoria, Australia > > 1 FAMS @F1794078@ > > 1 FAMC @F1794093@ > > 0 @I98BX-N6@ INDI > > 1 NAME Charles Edwin /THORNTON/ > > 2 GIVN Charles Edwin > > 2 SURN THORNTON > > 1 AFN 98BX-N6 > > 1 SEX M > > 1 SOUR @S01@ > > 1 FAMS @F1794093@ > > 0 @I98BX-PC@ INDI > > 1 NAME Emily /GROWDON/ > > 2 GIVN Emily > > 2 SURN GROWDON > > 1 AFN 98BX-PC > > 1 SEX F > > 1 SOUR @S01@ > > 1 FAMS @F1794093@ > > 0 @I98CJ-BW@ INDI > > 1 NAME Percy William Growdon /BALDOCK/ > > 2 GIVN Percy William Growdon > > 2 SURN BALDOCK > > 1 AFN 98CJ-BW > > 1 SEX M > > 1 SOUR @S01@ > > 1 BIRT > > 2 DATE ABT 1876 > > 2 PLAC Geelong, Victoria, Australia > > 1 FAMC @F1794078@ > > 0 @I98BW-LP@ INDI > > 1 NAME Percy William Growdon /BALDOCK/ > > 2 GIVN Percy William Growdon > > 2 SURN BALDOCK > > 1 AFN 98BW-LP > > 1 SEX M > > 1 SOUR @S01@ > > 1 BIRT > > 2 DATE 1879 > > 2 PLAC Geelong, Victoria, Australia > > 1 DEAT > > 2 DATE 6 Sep 1886 > > 2 PLAC Geelong, Victoria, Australia > > 1 FAMC @F1794078@ > > 0 @I98BW-KJ@ INDI > > 1 NAME Arthur Jabez /BALDOCK/ > > 2 GIVN Arthur Jabez > > 2 SURN BALDOCK > > 1 AFN 98BW-KJ > > 1 SEX M > > 1 SOUR @S01@ > > 1 BIRT > > 2 DATE 1878 > > 2 PLAC Geelong, Victoria, Australia > > 1 FAMC @F1794078@ > > 0 @I98BW-P7@ INDI > > 1 NAME Gladys Claudine /BALDOCK/ > > 2 GIVN Gladys Claudine > > 2 SURN BALDOCK > > 1 AFN 98BW-P7 > > 1 SEX F > > 1 SOUR @S01@ > > 1 BIRT > > 2 DATE 1887 > > 2 PLAC Geelong, Victoria, Australia > > 1 DEAT > > 2 DATE 1907 > > 2 PLAC > > 1 FAMC @F1794078@ > > 0 @I98BW-N2@ INDI > > 1 NAME Clive Alfred /BALDOCK/ > > 2 GIVN Clive Alfred > > 2 SURN BALDOCK > > 1 AFN 98BW-N2 > > 1 SEX M > > 1 SOUR @S01@ > > 1 BIRT > > 2 DATE 1884 > > 2 PLAC Geelong, Victoria, Australia > > 1 DEAT > > 2 DATE 25 Oct 1951 > > 2 PLAC > > 1 FAMC @F1794078@ > > 0 @I98BW-MV@ INDI > > 1 NAME Lawrence /BALDOCK/ > > 2 GIVN Lawrence > > 2 SURN BALDOCK > > 1 AFN 98BW-MV > > 1 SEX M > > 1 SOUR @S01@ > > 1 BIRT > > 2 DATE 1881 > > 2 PLAC Geelong, Victoria, Australia > > 1 FAMC @F1794078@ > > 0 @F1794078@ FAM > > 1 HUSB @I3GLR-Z3@ > > 1 WIFE @I98BW-JC@ > > 1 CHIL @I98CJ-BW@ > > 1 CHIL @I98BW-LP@ > > 1 CHIL @I98BW-KJ@ > > 1 CHIL @I98BW-P7@ > > 1 CHIL @I98BW-N2@ > > 1 CHIL @I98BW-MV@ > > 1 MARR > > 2 DATE 20 Apr 1876 > > 2 PLAC Geelong, Victoria, Australia > > 0 @F524078@ FAM > > 1 HUSB @I3GLR-4R@ > > 1 WIFE @I3GLR-5X@ > > 1 CHIL @I3GLR-Z3@ > > 0 @F1794093@ FAM > > 1 HUSB @I98BX-N6@ > > 1 WIFE @I98BX-PC@ > > 1 CHIL @I98BW-JC@ > > 0 TRLR > > > > -- > > Steve Hayes from Tshwane, South Africa > > Blog: http://khanya.wordpress.com > > E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk I agree for the most part. What I think is needed are a bunch of single purpose utilities that operate on GEDCOMs, sort of in the spirit of *nix. AWK scripts are fine if the person has AWK installed but I think the programming language is irrelevent. 15-20 years ago a wrote a couple of DOS utilities. One did nothing except remove dates and locations from living people. Another produced an HTML file from a GEDCOM. That's all they did. Later on I a wrote a small utility that did nothing except check for internal consistancy. Right now I would love a utility that does nothing except produce a descendancy chart. Or a utility that does nothing except produce group sheets. There is little reason for every genealogy program being able to fulfill every conceivable function. Think small. --

    02/18/2013 11:19:16