in reply to Converting GEDCOM files
I expect I haven't gotten that quite right. (Does '1 NAME data' appear in the file literally, or is that what certain strings in the file look like?) It would be very helpful to see a snippet of the input file. :) Anyway, that should get you started.#!/usr/local/bin/perl -w use strict; $/ = 'SOUR'; # read in one record at a time $^I = '.bak'; # modify input files in place, save originals with .bak my %convert = ( HEAL => 'Medical', HIST => 'Biography', EDUC => 'Educated', RESI => 'Resided', OCCU => 'Occupation', ); my $convert_re = join '|', keys %convert; $convert_re = qr/\b($convert_re)\b/; while (<>) { s/$convert_re/NOTE $convert{$1}:/g; s/1 NAME data/1 TITLE/; s/1 NAME data/1 TEXT/; s/1 NAME data/2 CONT/g; } continue { print; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Converting GEDCOM files
by Joes (Acolyte) on Jul 08, 2001 at 03:53 UTC |