CSV template for Text Import

This is a sample CSV that can be pasted into the Import Text addon gramplet.

It demonstrates a FEW of the recent improvements to the Import and provides a template for people who would like to use a spreadsheet for mass entries.

It is even more simple to copy and paste from a spreadsheet when the “Excel-tab” delimiter is selected for text import instead of the default to comma in Excel. It does not require saving a file and finding it for import. Nor do you need placeholder commas and quotes when using commas. Save the file to a .csv text file and import into your favorite spreadsheet.
The View → Configure… options for CSV Dialect in the People View:

The failure to use square brackets around the Place identifier for the German places was INTENTIONAL. The demonstrates how the Import Text will create a new record if there is a conflict with an existing ID. (It is a good example for testing the Isotammi automatic multimerge too!)

Place,Title,Name,Type,Latitude,Longitude,Code,Enclosed_by,Date
[P0957],USA,USA,Country,,,,,
[P0957a],British Colonies,British Colonies,Territory,,,,,
[P0958],Deutschland,Deutschland,Country,,,,,
P1111,"Bayern, DE",Bayern,State,,,,[P0958],
P1112,"Niederbayern, Bayern, DE",Niederbayern,District,,,,P1111,
P1113,"Passau, Niederbayern, Bayern, DE",Passau,County,,,,P1112,
P1114,"Ruhstorf a d Rott, Passau, Niederbayern, Bayern, DE",Ruhstorf a d Rott,City,48.4389,13.3332,94099,P1113,
[P0020],Republic of Mexico,Republic of Mexico,Country,,,,,1821
[P0007a],"Alta California, Republic of Mexico",Alta California,Territory,,,,[P0020],bef 2 Feb 1848
[P0050],"OH, USA",OH,State,,,,[P0957],
[P0007],"CA, USA",CA,State,,,,[P0957],9 Sep 1850
[P0022],"WA, USA",WA,State,,,,[P0957],
[P0029],"TN, USA",TN,State,,,,[P0957],
[P0032],"SC, USA",SC,State,,,,[P0957],
[P0036],"AR, USA",AR,State,,,,[P0957],
[P0039],"IN, USA",IN,State,,,,[P0957],
[P0041],"MS, USA",MS,State,,,,[P0957],
[P0042],"NM, USA",NM,State,,,,[P0957],
[P0059],"SD, USA",SD,State,,,,[P0957],
[P0062],"LA, USA",LA,State,,,,[P0957],
[P0066],"MT, USA",MT,State,,,,[P0957],
[P0070],"ID, USA",ID,State,,,,[P0957],
[P0239],"Humboldt, CA, USA",Humboldt,County,,,,[P0007],
[P0266],"Greene, AR, USA",Greene,County,,,,[P0036],
[P0316],"LaPorte, IN, USA",LaPorte,County,,,,[P0039],
[P0409],"Twin Falls, ID, USA",Twin Falls,County,,,,[P0070],
[P0433],"Washington, LA, USA",Washington,Parish,,,,[P0062],
[P1131],"Aberdeen, WA",Aberdeen,City,,,,[P0022],
[P1132],"Bogalusa, LA",Bogalusa,City,30.7910204,-89.8486858,,[P0433],
[P1388],"Portsmouth, OH",Portsmouth,City,,,,[P0050],
[P1398],"Albuquerque, NM",Albuquerque,City,,,,[P0042],
[P1414],"Eureka, CA",Eureka,City,40.8020712,-124.1636729,,[P0239],
[P1435],"Great Falls, MT",Great Falls,City,,,,[P0066],
[P1494],"Knoxville, TN",Knoxville,City,,,,[P0029],
[P1498],"Paragould, AR",Paragould,City,36.0584021,-90.4973286,,[P0266],
[P1623],"Michigan City, IN",Michigan City,City,41.7075394,-86.8950297,,[P0316],
[P1643],"Aberdeen, SD",Aberdeen,City,,,,[P0059],
[P1661],"Myrtle Beach, SC",Myrtle Beach,City,,,,[P0032],
[P1678],"Twin Falls, ID",Twin Falls,City,42.5629668,-114.4608711,,[P0409],
[P1691],"Picayune, MS",Picayune,City,,,,[P0041],

Person,Surname,Given,Call,Suffix,Prefix,Title,Gender,Birth date,Birth place,Birth source,Baptism date,Baptism place,Baptism source,Death date,Death place,Death source,Burial date,Burial place,Burial source,Note
[I0044],Garner,Lewis Anderson,Anderson,Sr,,Dr.,male,21 Jun 1855,[P1435],Baptize registry 1850 - 1867 Great Falls Church,,,,28 Jun 1911,[P1678],,1 Jul 1911,[P1678],,
[I0106],Garner,Robert W.,,,,,male,24 Apr 1826/7 (Julian),[P1131],2nd Source,,,,3 Feb 1916,[P1114],,5 Feb 1916 (Mar25),[P1494],,
[I0045],Martel,Luella Jacques,,,,,female,23 Jan 1852,[P1414],3rd Source,,,,28 Apr 1921,[P1661],,30 Apr 1921,[P1661],,"Notes are forever"
[I0107],Zieliński,Phoebe Emily,,,,,female,12 Apr 1827,[P1132],,,,,7 Mar 1882,[P1398],,9 Mar 1882,[P1623],,

Marriage,Husband,Wife,Date,Place,Source,Note
[F0017],[I0044],[I0045],1 Apr 1875,[P1498],,
[F0018],[I0106],[I0107],4 Oct 1849,[P1498],,
[F0019],,,3 Jan 1823,[P1691],,
[F0306],,,,,,
[F0307],,,4 Apr 1840,,,

Family,Child
[F0018],[I0044]
[F0019],[I0106]
[F0306],[I0107]
[F0307],[I0045]

A post was split to a new topic: CSV Import errors

Further, here’s an example of adding multiple occupations, residences and attributes for the same person.

Note the square brackets around the Person ID for the Home Person (I0044 - Garner von Zieliński, Lewis Anderson Sr) in the Example.gramps sample Tree. The brackets keep the import from creating another new person.

Person, occupationdate, occupationplace, occupationplace_id, occupationsource, occupationdescr
[I0044],21 Jun 1855,,[P1435],2nd Source,"Retired"
[I0044],24 Apr 1826/7 (Julian),,[P1131],Other Source,"Farmer"
[I0044],23 Jan 1852,"Twin Falls, Twin Falls, ID, USA",,3rd Source,"Laborer"
[I0044],12 Apr 1827,"Washington DC, USA",,Another Source,"Janitor"

Person, residencedate, residenceplace, residenceplace_id, residencesource
[I0044],21 Jun 1855,,[P1435],2nd Source
[I0044],23 Jan 1852,"Twin Falls, Twin Falls, ID, USA",,3rd Source

Person,attributetype, attributevalue, attributesource
[I0044],Death Record,Idaho Cert. #145258,2nd Source
[I0044],Eye Color,Blue,3rd Source

References:

Response to Reddit.com/r/gramps thread 30 Aug 2024 "Importing .csv with multiple events of same type "
Updating from Gramps 5.1.5-1 to 5.2.3 resolved the import failure.

A user experimenting with this import tried the appended CSV data into their Tree. They were confused when the Import created the “Roger Moore” without apparent issue. However, the new person showed no sign of the 1924 Occupation of Barrister and the 1926 Residence in Anglia.

The problem was that they specified I00001 for Moore… but there already existed a Person with that ID. So that conflict caused the import to assign the next available ID to Roger Moore. That was the correct behavior. (If the Import was supposed to overwrite the names of that pre-existing Person and add the Occupation and Residence from the first table, then that ID should have had square brackets too.)

Yet the for the Event adding lines, the [I00001] successfully found that pre-existing individual and added the Occupation and Residence to that person.

They need to Edit → Undo CSV Import immediately. (Or at least lookup Individual I00001 and see how many extra Occupations and Residences need to be deleted.) This is a reminder that Import is a risky process. Always make a backup before risky processes.

Finally, always check the ranges of IDs in your tree before importing. Any IDs specified in the CSV should start after those if your import uses the square brackets feature.

Person, firstname, lastname, birthdate, birthplace,  occupationdescr,  occupationdate,  occupationplace,  residencedate,  residenceplace
I00001, Roger, Moore, 01.01.1901, Houston, Actor, 02.02.1920, Maine, 03.05.1920, New York

Person,  occupationdescr,  occupationdate,  occupationplace,  occupationplace_id,  occupationsource,  residencedate,  residenceplace,  residenceplace_id,  residencesource
[I00001], Barrister, 03.04.1924, Scotland, , , 03.05.1926, Anglia, , 

Let’s try again with suffixes for the IDs that will ensure uniqueness.

Person, firstname, lastname, gender, birthdate, birthplace, occupationdescr, occupationdate, occupationplace, residencedate, residenceplace
I00001_aug2024, Roger, Moore, male, 01.01.1901, Houston, Actor, 02.02.1920, Maine, 03.05.1920, New York

Person, occupationdescr, occupationdate, occupationplace, occupationplace_id, occupationsource, residencedate, residenceplace, residenceplace_id, residencesource
[I00001_aug2024], Barrister, 03.04.1924, Scotland, , , 03.05.1926, Anglia, ,

Here is a Note with a sample Repository Note with TSV data:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE database PUBLIC "-//Gramps//DTD Gramps XML 1.7.1//EN"
"http://gramps-project.org/xml/1.7.1/grampsxml.dtd">
<database xmlns="http://gramps-project.org/xml/1.7.1/">
  <header>
    <created date="2025-01-16" version="5.2.4"/>
  </header>
  <repositories>
    <repository handle="_f33030f44f0555a075c42694192" change="1671176908" id="R0000">
      <rname>Gramps wiki</rname>
      <type>Web site</type>
      <url  href="https://www.gramps-project.org/wiki/index.php/Addon:ImportGramplet" type="Web Home" description="User Guide to the Import Text add-on for Gramps genealogy software"/>
      <noteref hlink="_f3301ba859752954d07590eced5"/>
    </repository>
  </repositories>
  <notes>
    <note handle="_f3301ba859752954d07590eced5" change="1737073734" id="N0000" type="General">
      <text>This is an example of import-ready CSV data for the Import Text Gramplet, a Gramps add-on. This introductory information will be ignored because the section doesn't have a header line with any of the keywords. Sections are separated by blank lines. The default import format is CSV. But the following data is separated by Tabs, not Commas.  So After adding the Text Import gramplet to a list view (such as the Families category view) in Gramps, choose Configure from the View menu, choose the &quot;CSV Dialect&quot; tab, click the &quot;Custom&quot; radio button and choose the &quot;Tab&quot; delimiter. Close the Configure dialog and the Text Import will now look for Tab Separated Values. 

Place	Title	Name	Type	Latitude	Longitude	Code	Enclosed_by	Date								
P0	USA	USA	Country	38.9072	-77.0369											
P1	New York, USA	New York	State	40.7128	-74.0060		USA									
																
Person	Title	Given	Prefix	Surname	Suffix	Call	Gender	Birth date	Birth place	Birth source	Baptism date	Baptism place	Baptism source	Death date	Death place	Death source
i1	Rev.	Mark John		Smith	Sr.	John		3/3/1953	Springfield, Illinois, USA					Mar 2022	New York, USA	
i2		Mary	von	Jones				12/19/1956	Franklin county, Pennsylvania, USA							
i3		Mark John		Smith	Jr.	Mark	male	6/3/1985	Harrisburg, Pennsylvania, USA							
 																
Marriage	Husband	Wife	Date	Place	Source	Note										
M1	I1	I2	1980	Odd, West Virginia, USA												
																
Family	Child															
M1	I3															
</text>
      <style name="bold">
        <range start="52" end="72"/>
        <range start="665" end="729"/>
        <range start="863" end="1029"/>
        <range start="1303" end="1348"/>
        <range start="1425" end="1438"/>
      </style>
      <style name="fontcolor" value="#cc0000">
        <range start="0" end="663"/>
      </style>
      <style name="link" value="https://www.gramps-project.org/wiki/index.php/Addon:ImportGramplet">
        <range start="52" end="72"/>
      </style>
    </note>
  </notes>
</database>