Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Going from PDF to GEDCOM

by jedikaiti (Hermit)
on Nov 08, 2010 at 02:48 UTC ( [id://870010]=perlquestion: print w/replies, xml ) Need Help??

jedikaiti has asked for the wisdom of the Perl Monks concerning the following question:

So a while back, I lost my external (backup) hard drive, from which I had not yet restored my family tree data when my laptop got replaced. I have, however, managed to get most of the information back (well, for one side of the family) from one of my cousins, who had a couple of PDFs I had sent him.

My project now is to get the info from the PDFs into a GEDCOM file with a relative minimum of hassle. I have found a GEDCOM module that should help with getting the data into the GEDCOM file - but first I have to tease it from a couple of PDFs which are structured to be read by humans.

I have no idea how to tease out the data. If it makes it easier to deal with, I have no problem just copy & pasting the contents into a text file. Maybe I should - one doc starts with a cover page followed by 64 pages of descendant tree diagram, and ending with another 13 pages of sources and index. I have been thinking perhaps I read in the text and use some regexes to filter the relevant data. If anyone has any better ideas, however, I would looooove to hear them

Here's a sample of what the data looks like:

Abner Trimble-1 [1]. Record Change on 09 May 2004 [1]. He was born in +England [2]. Polly Hawthorne [1]. Record Change on 09 May 2004 [1]. She was born in + Germany [2]. Abner Trimble and Polly Hawthorne. They were married on 12 Apr 1814 in + Franklin Co., Ohio. Record Change on 17 Dec 2004 [1]. They had 1 child. 2. i. John A. Trimble [1, 3]. He was born on 10 Oct 1819 in Franklin, +Ohio, USA [1]. He married Sarah Elizabeth Wilcox. They were married on 10 Oct 1846 in Mo +nona, Iowa, USA [1]. Residence 1860 in Monona, Iowa [4]. He died on 14 Apr 1 +893 in Castana, Monona, Iowa, USA [1]. Record Change on 20 Oct 2004 [1]. Generation 2 2. John A. Trimble-2 (Abner Trimble-1) [1, 3]. He was born on 10 Oct 1 +819 in Franklin, Ohio, USA [1]. Residence 1860 in Monona, Iowa [4]. He died on 14 Apr 1893 in Castana, + Monona, Iowa, USA [1]. Record Change on 20 Oct 2004 [1]. Notes for John A. Trimble: General Notes: [Trimble-Savage.ged] John Trimble, one of the old pioneers of Monona Co, came here in 1859, + & on the 9th of March, that year took up his residence at Old Mapleton. The following year he + moved on to the Hamilton Wiley farm which he had rented & lived there untill 1863. In the later + year he moved to the place of Seth Smith Jr., & there made his home for five years, engaged in ti +lling the soil. In November, 1868, he filed a claim under the homestead law upon eighty acres of la +nd on section 12, Kennebec Township, where he now lives. He proved up upon this place wh +ich was found to be upon the railroad grand, & nothwithstanding his prior right, his title + was invalidated & he was compelled to purchased it again of the railroad company. Mr. Trimble i +s a native of Franklin Co, Ohio & was born October 10, 1819, beneath the humble roof of his paren +ts, Abner & Polly (Hawthorne) Trimble. in his infancy he was bereft of both parents, & w +ithout a loving mothers care, he wa raised by a Mr. Rodgers, with whose family he remained untill he + was ten years of age. From that time untill attaining his seventeenth year, he lived with Wi +lliam Sullivan, but on attaining manhood commenced driving stage for what was afterward the Ohio Stage +Company. He raimed with the latter about six years, & then moved on westward & at Chicago + & Milwaukee, was employed for about fifteen years in the same business, at first for Fr +ink & Walker, & later for the Wisconsin State Company. In the bars of the last named company, & in t +he livery business on his own account, he remained for nearly five years & then traveled with Ju +n & Turneys circus for one season. drifting to Council Bluffs, in January, 1859, he there heard o +f this county, (Monona) & came here as above stated , & has made his home ever since. Mr Trimble + was married October 10, 1846, to Miss. Sarah E. Wilcox, a native of Kentucky, who was born + January 24, 1824, & who is the daughter of Benjamin & Flora (McCormick) Wilcox. Her father die +d in Kentucky, February 24, 1836, & her mother in ILLinois, whither she had moved , June 23, 1 +880. Of Mr. & Mrs. Trimble family of four children, the following is recorded as the date of thei +r birth; William W., September 15, 1847, who died November 02, 1855, John A. , February 10, 1850, Cha +rles F., February 10, 1852 & Marietta E., July 23, 1854 Illiterate, according to 1885 Iowa census Sarah Elizabeth Wilcox is the daughter of Benjamin Wilcox and Flora Mc +Cormick [1]. She was born on 24 Jan 1824 in Kentucky, USA [1]. Residence 1880 in Kennebec, +Monona, Iowa, USA [5, 2]. She died 1903 in Kennebec, Monona, Iowa, USA [1]. Record Change on 10 +May 2004 [1]. 65 Register Report for Abner Trimble Generation 2 (con't) John A. Trimble and Sarah Elizabeth Wilcox. They were married on 10 Oc +t 1846 in Monona, Iowa, USA [1]. Record Change on 17 Dec 2004 [1]. They had 4 children. i. William W Trimble [1]. He was born on 15 Sep 1847 [1]. Residence 18 +50 in Milwaukee Ward 2, Milwaukee, Wisconsin [6]. He died on 02 Nov 1855 [1] +. Record Change on 20 Oct 2004 [1]. 3. ii. John Adams Trimble [1, 7, 6]. He was born on 10 Feb 1850 in Mil +waukee, Wisconsin, USA [8]. He married Sarah C. Mellon. They were married on 0 +1 Jan 1868 in Monona, Iowa, USA [1]. Residence 1880 in Kennebec, Monona, Iow +a, USA [9]. He died on 17 Jun 1913 in Enterprise, Wallowa, Oregon, USA [1 +, 10]. Record Change on 09 May 2004 [1]. Cause Of Death was Pneumonia. iii. Charles F. Trimble [1]. He was born on 10 Feb 1852 in Wisconsin, +USA [1]. Residence 1930 in Hopkins, Nodaway, Missouri, USA [11]. Record Change +on 09 May 2004 [1]. He died [1]. 4. iv. Marietta Elizabeth Trimble [1]. She was born on 23 Jul 1854 in +Wisconsin, USA [1]. She married William David Bayliss. They were married on 01 Jan 18 +71 in Castana, Monona, Iowa, USA. Residence 1930 in Hopkins, Nodaway, Missou +ri, USA [11]. She died on 05 Jan 1933 in Hopkins, Nodaway, Missouri, USA [ +1]. Record Change on 09 May 2004 [1]. Generation 3 3. John Adams Trimble-3 (John A. Trimble-2, Abner Trimble-1) [1, 7, 6] +. He was born on 10 Feb 1850 in Milwaukee, Wisconsin, USA [8]. Residence 1880 in Kennebec, Monona, +Iowa, USA [9]. He died on 17 Jun 1913 in Enterprise, Wallowa, Oregon, USA [1, 10]. Record Cha +nge on 09 May 2004 [1]. Cause Of Death was Pneumonia. Notes for John Adams Trimble: General Notes: John Guy's death cert lists John A's place of birth as Iowa Sarah C. Mellon is the daughter of Jessee Milton and Mary Hardin [1]. +She was born 1851 in Illinois, USA [1]. Residence 1880 in Kennebec, Monona, Iowa, USA [9]. +Record Change on 09 May 2004 [1]. She was also known as Sadie. She died [1]. Notes for Sarah C. Mellon: General Notes: Listed as "Sadie" in Charles A. Trimble's obit John Guy's death cert lists her place of birth as Iowa John Adams Trimble and Sarah C. Mellon. They were married on 01 Jan 18 +68 in Monona, Iowa, USA [1]. Record Change on 17 Dec 2004 [1]. They had 5 children. 5. i. Charles A. Trimble [1]. He was born on 11 Nov 1869 in Monona, Io +wa, USA [1, 12]. Residence 1880 in Kennebec, Monona, Iowa, USA [9]. He married Lydia Is +abelle (Bell) Beatley. They were married on 17 Jun 1896. He died on 23 Nov 19 +42 in Onawa, Monona, Iowa, USA [1, 12]. Burial on 25 Nov 1942 (Castana Cemet +ery, Castana , Iowa, USA) [1, 12]. Record Change on 17 Dec 2004 [1]. 66 Register Report for Abner Trimble Generation 3 (con't) 6. ii. Jessie May Trimble [1]. She was born on 30 Nov 1871 in Monona, +Iowa, USA [1]. Residence 1880 in Kennebec, Monona, Iowa, USA [9]. She married Edwin M +. Tucker. They were married on 01 Mar 1893. She died on 26 Mar 1938 in Colorado Springs, El Paso, Colorado, USA [1]. Record Change on 09 May +2004 [1]. Burial in Evergreen Cemetery, Colorado Springs, CO. 7. iii. Effie L. Trimble [1, 9, 13]. She was born May 1874 in Iowa, US +A [14]. Residence 1900 in Interior, Stanley, South Dakota [14]. Record Change on 09 May 2004 +[1]. She died [1]. 8. iv. John Guy Trimble [1, 15, 16, 16, 17, 18, 19]. He was born on 10 + Oct 1876 in Iowa, USA [1, 15, 20, 21, 17, 18, 22, 23, 19]. He married Lucy Agnes Randall. They w +ere married on 27 Oct 1912 in Kadoka, Jackson, South Dakota, USA [24]. Residence on 01 Jan 1 +937 in Pine Ridge, Shannon, South Dakota, USA [25, 25, 18]. He died on 01 Feb + 1937 in Wanblee, Washabaugh Co., SD [1]. Burial on 03 Feb 1937 in Wanblee, Jac +kson, South Dakota, USA. Record Change on 22 Jun 2004 [1]. Cause Of Death wa +s Cerrebral Embolism, Endocarditis [7]. Occupation was Carpenter (from D +eath Certificate). v. Hattie Trimble. Residence 1942 in Taft, Kern, California, USA. 4. Marietta Elizabeth Trimble-3 (John A. Trimble-2, Abner Trimble-1) [ +1]. She was born on 23 Jul 1854 in Wisconsin, USA [1]. Residence 1930 in Hopkins, Nodaway, Missou +ri, USA [11]. She died on 05 Jan 1933 in Hopkins, Nodaway, Missouri, USA [1]. Record Change on 0 +9 May 2004 [1]. William David Bayliss. He was born on 01 Aug 1851 in St Louis, Missour +i, USA. He died on 06 Oct 1906 in Council Bluffs, Pottawattamie, Iowa, USA. William David Bayliss and Marietta Elizabeth Trimble. They were marrie +d on 01 Jan 1871 in Castana, Monona, Iowa, USA. They had 11 children. 9. i. Hannah Elizabeth Bayliss. She was born on 19 May 1872 in Mapleto +n, Monona, Iowa, USA. She married William Lewis Tucker. They were married on 11 F +eb 1892 in Mapleton, Monona, Iowa, USA. She died on 21 Sep 1901. 10. ii. Mary Ellen Bayliss. She was born on 02 Mar 1874 in Mapleton, M +onona, Iowa, USA. She married William Lewis Tucker. They were married on 03 Mar 190 +2 in Ames, Dodge, Nebraska, USA. She died on 09 Apr 1969 in Porterville, Tu +lare, California, USA. Burial in Hillcrest Memorial Park Cemetery. 11. iii. Flora Temperence Bayliss [26]. She was born on 01 Jun 1877 in + Mapleton, Monona, Iowa, USA. She married William Elmer Hutcheson. They were marr +ied on 24 May 1902 in Onawa, Monona, Iowa, USA. Residence 1930 in Hopkins, Nodaway, Missouri, USA [11]. She died on 12 Aug 1942 in Casper, Natron +a, Wyoming, USA. Burial in Highland Cemetery. 12. iv. Bearnard Bertram Bayliss. He was born on 10 Mar 1880 in Maplet +on, Monona, Iowa, USA. He married Elizabeth Anna Rodgers. They were married on 26 +Dec 1900 in Bassett, Rock, Nebraska, USA. He died on 02 Dec 1967 in Juncti +on City, Lane, Oregon, USA. Burial in Rest Lawn Memorial Cemetery. v. Clarabella Christina Bayliss. She was born on 10 Sep 1882. She died + on 14 Sep 1883. 67 Register Report for Abner Trimble Generation 3 (con't) 13. vi. Blanche Rebecca Bayliss. She was born on 28 Jul 1884 in Iowa, +USA. She died on 05 Dec 1959 in Inyo, Kern Co, CA. Burial in Hillcrest Memorial Park + Cemetery. 14. vii. William Willard Bayliss. He was born on 04 Jan 1887 in Holt, +Nebraska, USA. He married Lillian Mae Rodgers. They were married on 23 Jan 1908 in St +erling, Logan Co, CO. He died on 05 Dec 1962 in Butte, Silver Bow, Montana, US +A. Burial in Merriman Community Cemetery, Merriman, NE. 15. viii. Mercy May Bayliss. She was born on 16 Oct 1889 in Stuart, Ho +lt, Nebraska, USA. She married Arthur Alpheus Holl. They were married on 10 Mar 1910 +. She died on 23 Nov 1974 in West Hollywood, Broward Co, FL. 16. ix. Echo Etta Bayliss. She was born on 18 Feb 1892 in Stuart, Holt +, Nebraska, USA. She married William Alonzo Shull. They were married on 06 Apr 191 +0. She died on 22 Jan 1981 in Modesto, Stanislaus, California, USA. 17. x. Orrin Bayington Bayliss. He was born on 18 Apr 1894 in Nebraska +, USA. He married Alta Charlotte Martin. They were married 1915. Residence 1930 +(1930 Census lists Orrin as an inmate in the State of South Dakota). He died + on 19 Jun 1966 in Batesland, Shannon, South Dakota, USA. Burial in Merriman Memo +rial Cemetery, Merriman, Cherry Co, NE. xi. Lewis Thomas Bayliss. He was born on 16 Jul 1899 in Rock, Nebraska +, USA. He died on 10 Apr 1901 in Iowa, USA. Burial in Castana, Monona, Iowa, +USA.

Thanks, guys!
Kaiti

Kaiti
Swiss Army Nerd

Replies are listed 'Best First'.
Re: Going from PDF to GEDCOM
by Anonymous Monk on Nov 08, 2010 at 16:23 UTC
    First idea, run strings, count the number of occurences and you 'll get the most common words ( burial/in/on/he/she/they/died/born/married )

    To get sentences, slurp a page, split on period not followed by a comma (or other punctuation).

    Then split into parts based on the common words and do something with them.

    But, I've no idea how a sentence (or a bunch) translate into gedcom calls.

    How did you generate the sentences in the first place? Reverse that process

      Thanks! The getting-into-PDF process was actually automated by Family Tree Maker software, into which the GEDCOM file will be imported (once I find and reinstall it - STILL unpacking from moving in July!).

      Yes, I think I can start by separating individuals by looking for lines that begin with a number, a period, and a space. Well, most. Spouses may need to be identified using the common words method.

      Gave a little more thought to it late last night, and most people in this file are listed twice - as the children of their parents (short listing) and the more detailed individual listings. So I also need to match those up, and account for possible same names. I think I can do that by getting the basic info (name, DOB, DOD) from the short listing, then for the individual listings merging any records for whom those 3 details match, and treating anyone else as a new individual.

      Thanks again!
      Kaiti
      Swiss Army Nerd

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://870010]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-24 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found