Re: solved: Family names for marriages only, was: Need help using Gedcom.pm
[email protected] (Ron Savage) Tue, 13 Jun 2017 08:54:28 +1000
| Newsgroups | perl.gedcom |
|---|---|
| Message-ID | <[email protected]> |
Hi Jutta
OK. Glad your problem is solved.
On 12/06/17 23:37, Jutta Wrage wrote:
>
> 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:
>>
>> o https://savage.net.au/misc/jutta.ged
>>
>> o https://savage.net.au/misc/jutta.log
>>
>> o https://savage.net.au/misc/jutta.sample (Rename to jutta.pl)
>>
>> 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 = $i->fams;
> my $sex = uc $i->sex;
> if ($sex eq "F") {
> my $firsthusband = 1;
> for my $f (@families) {
> if (my $marriage = $f->marr()) {
> if(my $husband = $f->husband()) {
> my $husbname = $husband->get_value(["name", 1], "surn");
> if ($firsthusband) {
> $surname .= "$husbname";
> $firsthusband = 0;
> } else {
> $surname .= ", $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.
>
> Once one gets an idea how to use the modules, they are really great.
>
> Regards,
>
> Jutta
>
>
--
Ron Savage - savage.net.au