Return-Path: <@yonge.csri.toronto.edu:ian@sq.sq.com> Received: from sq.sq.com ([192.31.6.1]) by yonge.csri.toronto.edu with SMTP id <29>; Fri, 24 Jan 1992 13:21:52 -0500 Received: by sq.sq.com (/\=-/\ Smail3.1.18.1 #18.1) id ; Fri, 24 Jan 92 13:21 EST Message-Id: To: saw@hallc1.cebaf.gov (Stephen A. Wood) Cc: ian@sq.com, paddyw@lbs.lon.ac.uk Subject: Re: Anonymous FTP site for genealogy ... In-Reply-To: Your message of 24 Oct 91 06:33:12 +0000. Date: Fri, 24 Jan 1992 13:20:41 -0500 From: ian@sq.com I don't know if you're interested in UNIX programs, but here is one that tries to convert an "Expert Roots" PC database into GEDCOM. I wrote it, and it's freely copiable by anyone for any purpose. Here it is. It needs awk and probably sed, as well as Henry Spencer's general- purpose dbase3-file reader, which I'm sending in the next message. Ian Darwin ian@sq.com : To unbundle, sh this file directory roots2ged mkdir roots2ged 2>/dev/null echo x - roots2ged/Makefile 1>&2 sed 's/^X//' >roots2ged/Makefile <<'@@@End of roots2ged/Makefile' Xall: roots.ged X Xroots.ged: namefile.dbf roots2ged.awk roots2ged.sh X sh roots2ged.sh X vi $@ X Xprt: X dbase3 namefile.dbf | more @@@End of roots2ged/Makefile echo x - roots2ged/README 1>&2 sed 's/^X//' >roots2ged/README <<'@@@End of roots2ged/README' XThis directory contains "roots2ged", a simple program that Xconverts from "Expert Roots" (Expert Software, Florida) into XGEDCOM format. X XYou MUST HAVE: X - Henry Spencer's "dbase3" program X - sed (or modify dbase3 to not print the header) X - an awk that supports user functions (mawk, nawk, gawk, ...). X - pipes, or rewrite the .sh as a batch file using temporary files. X XThis is NOT EXTENSIVELY TESTED; a quick hack to convert a small database. XSee the WARNING in the awk source file. KEEP YOUR INPUT FILES FOREVER. X XSee the legal notice in the awk source file for limitation of liability!!! X XIt makes NO EFFORT to convert the notes from the ".dbt" file, which is Xin some weird format. X XAny problems, don't call me - fix it, and send me thy fixes. X XIan Darwin Xian@sq.com XJanuary, 1992. @@@End of roots2ged/README echo x - roots2ged/roots2ged.awk 1>&2 sed 's/^X//' >roots2ged/roots2ged.awk <<'@@@End of roots2ged/roots2ged.awk' X# Convert an "Expert Roots" file to GEDCOM. X# $Id: roots2ged.awk,v 1.5 92/01/23 22:20:43 ian Exp $ X X# The file must have been converted to tab-separated, blank-stripped records X# (presumably using Henry Spencer's dbase3 program, and the header stripped). X# X# Most of the complexity, such as 'tis, derives from the fact that Expert Roots X# doesn't store families as entities, only individuals are entities, X# so the family structures must be reconstructed. X# X# WARNING -- X# The algorithm for generating family numbers can produce duplicates; X# this should be checked for in the code, but isn't because I was running X# on a very small sample. CAVEAT LECTOR!!!!! X# X# The rest of the complexity is due to GEDCOM's finnickiness about formatting. X# X# The use of "0+" throughout is to ensure that awk treats things as numbers. X X# Copyright (c) Ian F. Darwin, Toronto, Canada: 1992> X# Written by Ian F. Darwin. X# X# This software is not subject to AND MAY NOT BE MADE SUBJECT TO any X# license of the American Telephone and Telegraph Company, Sun X# Microsystems Inc., Digital Equipment Inc., Lotus Development Inc., the X# Regents of the University of California, The X Consortium or MIT, or X# (in particular) The Free Software Foundation. X# X# This software is not subject to any export provision of the United States X# Department of Commerce, and may be exported to any country or planet. X# X# Permission is granted to anyone to use this software for any purpose on X# any computer system, and to alter it and redistribute it freely, subject X# only to the following restrictions: X# X# 1. The author is not responsible for the consequences of use of this X# software, no matter how awful, even if they arise from flaws in it. X# X# 2. The origin of this software must not be misrepresented, either by X# explicit claim or by omission. Since few users ever read sources, X# credits must appear in the documentation. X# X# 3. Altered versions must be plainly marked as such, and must not be X# misrepresented as being the original software. Since few users X# ever read sources, credits must appear in the documentation. X# X# 4. This notice may not be removed or altered. X XBEGIN { X # names for fields X # WARNING check that these agree with the "header" in YOUR X # version of "Expert Roots"!!! X LNAME = 1 X FNAME = 2 X STREET = 3 X CITY = 4 X STATE = 5 X ZIP = 6 X COUNTRY = 7 X NOTES = 8 X DOB = 9 X DOM = 10 X DOD = 11 X POB = 12 X POM = 13 X POD = 14 X F_ID = 15 X M_ID = 16 X S_ID = 17 X P_ID = 18 X MEMO = 19 X SEX = 20 X} X X # set up months for GEDCOM, which needs dates in X # 2 DATE 11 JUL 1767 X # format. XBEGIN { X x = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" X n = split(x, months, " "); X # print n, "months, months[4] = ", months[4] X } X X # input s is DD/MM/YYYY, want in above format. Xfunction gcdate(s) { X n = split(s, a, "/") X if (n != 3) { X print "Date", s, "is no good" X return "" X } X t = sprintf("%s %s %s", a[1], months[0+a[2]], a[3]) X return t X } X X # print mandatory GEDCOM header. XBEGIN { X print "0 HEAD" X print "1 SOUR ROOTS2GED" X print "1 DEST PAF" X print "1 DATE 1 JAN 1992" X print "1 FILE STDIN.GED" X} X X # Main loop... Processed once per individual. X { X print "0 @I" 0+$P_ID "@" , "INDI" X print "1 NAME", $FNAME, "/" $LNAME "/" X print "1 SEX", $SEX X X if ($DOB != "" || $POB != "") { X print "1 BIRT" X if ($DOB != "") X print "2 DATE", gcdate($DOB) X if ($POB != "") X print "2 PLAC", $POB X } X if ($DOD != "" || $POD != "") { X print "1 DEAT" X if ($DOD != "") X print "2 DATE", gcdate($DOD) X if ($POD != "") X print "2 PLAC", $POD X } X X parentfam = $F_ID * $M_ID X if (parentfam) { X print "1 FAMC @F" parentfam "@" X husb[parentfam] = 0+$F_ID X wife[parentfam] = 0+$M_ID X } X X thisfam = (0+$P_ID) * (0+$S_ID) X if (thisfam) { X print "1 FAMS @F" thisfam "@" X families[thisfam] = thisfamamily X mardates[thisfam] = 0+$DOM X marplace[thisfam] = 0+$POM X } X} X X # Post-EOF processing: dump out all the family info. XEND { X for (f in families) { X print "0 @F" f "@ FAM" X print "1 HUSB", husb[f] X print "1 WIFE", wife[f] X if (mardates[f] != "") X print "2 DATE", gcdate(mardates[f]) X if (marplace[f] != "") X print "2 PLAC", marplace[f] X } X} @@@End of roots2ged/roots2ged.awk echo x - roots2ged/roots2ged.sh 1>&2 sed 's/^X//' >roots2ged/roots2ged.sh <<'@@@End of roots2ged/roots2ged.sh' Xdbase3 namefile.dbf | X sed 1,/---/d | \ X mawk -F' ' -f roots2ged.awk > namefile.ged @@@End of roots2ged/roots2ged.sh