Changes

Jump to: navigation, search
m
Protected "Gramps 4.2 Wiki Manual - Manage Family Trees: CSV Import and Export": fix protection (lost after migration!) ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
{{grampsmanualcopyright}}
 
{{man index|Gramps 4.2 Wiki Manual - Manage Family Trees|Gramps 4.2 Wiki Manual - Probably Alive|4.2}}
 
{{languages|Gramps_4.2_Wiki_Manual_-_Manage_Family_Trees:_CSV_Import_and_Export}}
 
{{#vardefine:chapter|5.1}}
{{#vardefine:figure|0}}
 
{{out of date|The behavior of the program has changed in some points}}
== Gramps Spreadsheet Import/Export ==
{{man note|New feature since Gramps 3.3|Previously, sources were not exported, but now they are. Sources are referred to by their title text. You can add further details to a source after importing.}}
{{man note|New feature since Gramps 4.2.1|Now you can export and import place information. Also, you can refer to places in marriage and person sections by using a "place id". See below for more details.}}
There are three main uses for this format:
# Start Gramps
# Select "Export" from the menu {{man menu|Family Trees menu->Export...}}# Select {{man button|Next}} on the {{man label|Saving your data}} window.# Select "'''Comma Separated Values Spreadsheet (CSV)"''' on the {{man label|Choose the output format}} window# On the {{man label|Export options}} window.## In the top section select which filters to apply to your family tree# Select # From the checkboxes select which items to include in the export (people, marriages, familieschildren, and/or places)and whether to Translate headers into the language you are using.  
A selected set of fields of your genealogy data will be saved to a .csv file in the format described below. In addition, the people and families are referenced so that the data can be edited and read back in, thereby updating the database.
There are some columns that will be blank, specifically note and source columns. These are listed in the spreadsheet so that you can make notes for the import, but notes are never exported with this tool. '''{{man note|From Gramps 3.3 |you can now export source titles; previously no source data was exported.'''}}
Your data is broken up into four sections representing places, individuals, marriages, and children, and places. The exported fields and column names are:
;IndividualsPlaces: Person, Lastname, Firstname, Callname, Suffix, PrefixPlace, Title, Gender, Birthdate, Birthplace, Birthsource, Baptismdate, Baptismplace, Baptismsource, DeathdateName, DeathplaceType, DeathsourceLatitude, BurialdateLongitude, BurialplaceCode, BurialsourceEnclosed_by, NoteoteDate
;Individuals: Person, Lastname, Firstname, Callname, Suffix, Prefix, Title, Gender, Birthdate, Birthplace (or Birthplaceid), Birthsource, Baptismdate, Baptismplace (or Baptismplaceid), Baptismsource, Deathdate, Deathplace (or Deathplaceid), Deathsource, Burialdate, Burialplace (or Burialplaceid), Burialsource, Note ;Marriages: Marriage, Husband, Wife, Date, Place(or Placeid), Source, Note
;Families: Family, Child
 
;Places: Places, Title, Name, Type, Latitude, Longitude, Code, Enclosed_by, Date
The first column in each area is the Gramps ID. That is what will tie your edits back to the correct data, so don't alter those data. Load this file into your favorite spreadsheet using comma separated, double-quote text delimited, and Text format (any encoding for now). Then you can add or correct data, and save it back out, keeping the same format. You can then import the data back on top of your old data and it will be corrected.
{{man note|LibreOffice allows you to turn off auto-formatting when you open the CSV file.|If you don't do this, LibreOffice may interpret the dates incorrectly. Change the type of the column to Text rather than Standard. If your spreadsheet program doesn't allow you to format the fields before you get it into columns (eg, Excel) you need to change the display format of dates in Gramps before you export. You can do this under {{man menu|Edit -> Preferences -> Display -> Date Format}}}}.{{man note|Excel allows you to format columns as text when you open the CSV file.|If you don't do this, Excel may interpret the dates incorrectly. Change the type of the column to Text rather than General. One way to do this is to open the CSV from the file menu (select 'Text files' as the type in the file open dialog box). This brings up the 'Text Import Wizard' which allows you to select 'Delimited' by commas, and to select 'Text' for all the columns (select the first, scroll to last and shift-click to select all).}}.{{man note|Excel cannot directly save Unicode CSV files.|To save a CSV in Unicode, save to "Unicode Text (*.txt)", then open the file in Notepad++. Using Notepad++ 'Search' and replace menu, change all the tabs ('/t') to commas (','). Using Notepad++ 'Encoding' menu convert to "UTF-8-BOM" and save the file to CSV ('*.csv').}}
== Import ==
To import your data:
# use Use the file from above, or create a spreadsheet (described [[Gramps_4.2_Wiki_Manual_-_Manage_Family_Trees:_CSV_Import_and_Export#Example_CSV_with_multiple_areas|below]]) with genealogical data# start up Start Gramps# import Create a new Family Tree# Select from the menu {{man menu|Family Trees ->Import...}}# Select the '''Comma Separated Values Spreadsheet (CSV)''' file into your current databaseand then select the {{man button|Import}} button 
The merge part of this code will only add or update information to your database, and it always assume that the spreadsheet data is the correct version.
The spreadsheet is data made up of columns. Each column should have at the top of it the name of what type of data is in the column. You must use special names for the columns. Currently they are:
 
=== Place ===
 
<pre>
place - a reference to this place
title - title of place
name - name of place
type - type of place (eg, City, County, State, etc.)
latitude - latitude of place
longitude - longitude of place
code - postal code, etc.
enclosed_by - the reference to another place that encloses this one
date - date that the enclosed_by place was in effect
</pre>
=== People ===
birthdate - date of birth
birthplace - place of birth
birthplaceid - place id of birth
birthsource - source title for birth
baptismdate - date of baptism
baptismplace - place of baptism
baptismplaceid - place id of baptism
baptismsource - source title of baptism
grampsid - give a particular gramps id
deathdate - date of death
deathplace - place of death
deathplaceid - place id of death
deathsource - source title for death
deathcause - cause of death
burialdate - date of burial
burialplace - place of burial
burialplaceid - place id of burial
burialsource - source title of baptism
</pre>
date - the date of the marriage
place - the place of the marriage
placeid - the place id of the marriage
source - source title of the marriage
note - a note about the marriage/wedding
</pre>
=== Place =Details ==
<pre>places Column names are not case- a reference to this placetitle - title sensitive. You may use any combination of placename - name of placetype - type of place the columns, in any order. (egActually, Cityyou have to at least have a surname and a given name when defining a person, Countyyou have to have a marriage and child columns when defining children, Stateand places need a place reference, etcbut that is it.)latitude - latitude of placelongitude - longitude of placecode - postal code, etc.enclosed_by - The column names are the reference to another place that encloses this onedate - date that English names given (for now) but the enclosed_by place was data should be in effect</pre>your language (including the words "male" and "female").
== Details ==Top-to-bottom order is important in that if you want to reference something in one area to another, the definition MUST come first. For example, if you want to define families of people, the individuals must be defined before the families. The same applies to places. So it is usually best to put the Places data first, people next, then marriages and families.
Case doesn't matter. You may use any combination Each of these, can go in its own area in any ordera spreadsheet. (Actually, you have There is no limit to at least have the number of areas in a surname sheet, and a given name when defining a person, you have to each area can have any number of rows. Leave a marriage and child columns when defining children, and places need a place reference, but blank row between "areas". Just make sure that is it.) The column names areas are the English names given (for now) but the data should not next to each other; they must be in your language (including the words "male" above and "female")below one another.
Each You can have multiple areas of these can go in its own area in each kind on a spreadsheet. There The only limitation is no limit that if you refer to the number of areas a person, you must do that in a sheetrow lower than where that person is described. Likewise, and each area can have any number of rows. Leave if you refer to a marriage, you must do that in a blank row between "areas"lower than where the marriage is described. Just make sure that areas are not next References to each other; they enclosed_by places must already exist in the database, or be defined in rows above and below one anotherin the spreadsheet.
You can have multiple areas of each kind on If you use the 'grampsid' as a way to assign specific ids, be ''very'' careful when importing to a spreadsheetcurrent database. The only limitation is that if Any data you refer enter will '''overwrite''' the data assigned to a person, that grampsid. If you must do that use ids in a row lower than where that the place, person is described. Likewise, if you refer to a marriage, you must do or family columns that in a row lower than where are surrounded by brackets (for example '[I0001]'), the marriage is describedvalues you use will be interpreted as grampsids as well. References If you are adding '''new''' items, you are encouraged to enclosed_by places must already exist in avoid use of the databasebracket format or grampsid columns, so as to avoid accidentally overwriting your data. If you are mixing the bracket (or be defined above in grampsid) methods with plain references (no brackets), put the plain referenced data after the spreadsheetbracket referenced data.
If you are entering the data in a text file, and if you wish to have a comma inside one of the values, like "Clinton, Co., MO" then you need place the entire value in double-quotes and put the first double-quote right after the preceding comma. For example:
<pre>
marriage, person1parent1, person2parent2, place
m1, p1, p2,"Clinton, Co., MO"
m2, p3, p4,"Havertown, PA"
{{-}}
=== Example CSV with multiple areas ===
Here is an example of a CSV text spreadsheet with multiple areas:
<pre>
FirstnamePlace, SurnameTitle, BirthdateName, TypeJohn[P0001], Michigan, TesterMichigan, 11/11/1965StateSallyL1, Canada, Canada, CountryL2, USA, TesterUSA, 01/26/1973Country
Firstname, Surname, Birthdate, Birth place idJohn, Tester, 11/11/1965, L1Sally, Tester, 01/26/1973, L1 Person, Firstname, Surname, Birthdate, Birth place idp1, Tom, Smith, 22 Jan, 1970, [P0001]
p2, Mary, Jones
p3, Jonnie, Smith
p5, James, Loucher
p6, Penny, Armbruster
p7[P0002], Tim, Sparklet
Marriage, Husband, Wife
m1, p3
m1, p6
m2, p7 Place, Title, Name, Typep1, Canada, Canada, Countryp2, USA, USA, Country[P0002]
</pre>
Notice that you can use numbers or strings as the reference names between areas. In the person area, I used the numbers 1 through 16. That made it easy to refer to them in the second area of marriages. The marriages are labeled with the letters A through H.
 
 
{{man note|LibreOffice allows you to turn off auto-formatting when you open the CSV file|If you don't do this, LibreOffice may interpret the dates incorrectly. Change the type of the column to '''Text''' rather than '''Standard.''' If your spreadsheet program doesn't allow you to format the fields before you get it into columns (eg, Excel) you need to change the display format of dates in Gramps before you export. You can do this under {{man menu|Edit -> Preferences -> Display -> Date Format}}.}}
Also note that the children in the third area are existing people as indicated by the brackets around the Gramps IDs.
{{man index|Gramps 4.2 Wiki Manual - Manage Family Trees|Gramps 4.2 Wiki Manual - Probably Alive|4.2}}
{{grampsmanualcopyright}}
[[Category:Documentation|C]]

Navigation menu