solved: Family names for marriages only, was: Need help using Gedcom.pm
[email protected] (Jutta Wrage) Mon, 12 Jun 2017 15:37:15 +0200
| Newsgroups | perl.gedcom |
|---|---|
| Message-ID | <[email protected]> |
Am 12.06.2017 um 09:51 schrieb Ron Savage:
> I patched your ged data to make it validate, and wrote a little script =
to get you going. See:
>=20
> o https://savage.net.au/misc/jutta.ged
>=20
> o https://savage.net.au/misc/jutta.log
>=20
> o https://savage.net.au/misc/jutta.sample (Rename to jutta.pl)
>=20
> My web hosting company will not let me upload files with names like:
Thanks for you help!
Just before getting you mail I have found a solution yesterday after =
creating a family table with information whether married or not.
My code to get the names in the individual table now is:
my @families =3D $i->fams;
my $sex =3D uc $i->sex;
if ($sex eq "F") {
my $firsthusband =3D 1;
for my $f (@families) {
if (my $marriage =3D $f->marr()) {
if(my $husband =3D $f->husband()) {
my $husbname =3D $husband->get_value(["name", 1], =
"surn");
if ($firsthusband) {
$surname .=3D "$husbname";
$firsthusband =3D 0;
} else {
$surname .=3D ", $husbname";
}
}
}
}
}
This way I get only the new surnames for women if they are married.
And that matches to the information in the names section I have had =
already in my data and which I did not know, how to access using the =
gedcom modules. The only thing to do was adding marriage records without =
data everywhere, where I know they where married but had no data for the =
marriage.
My sources hav names like "HRE K NAME" for marriage entries in church =
books and so I can analyze automatically, where I have the original data =
and not only second level information already for birth, marriage and =
death.=20
Once one gets an idea how to use the modules, they are really great.
Regards,
Jutta
--=20
http://www.witch.westfalen.de