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>
==Details = Place === <pre>place - a reference to this placetitle - title of placename - name of placetype - type of place (eg, City, County, State, etc.)latitude - latitude of placelongitude - longitude of placecode - postal code, etc.enclosed_by - the reference to another place that encloses this onedate - date that the enclosed_by place was in effect</pre>
== Details ==Column names are not case-sensitive. You may use any combination of the columns, in any order. (Actually, you have to at least have a surname and a given name when defining a person, you have to have a marriage and child columns when defining children, and places need a place reference, but that is it.) The column names are the English names given (for now) but the data should be in your language (including the words "male" and "female").
Case doesn't matter. You may use any combination of theseTop-to-bottom order is important in that if you want to reference something in one area to another, in any orderthe definition MUST come first. (Actually For example, if you have want to at least have a surname and a given name when defining a persondefine families of people, you have the individuals must be defined before the families. The same applies to have a marriage and child columns when defining children, and places need a place reference, but that . So it is it.) The column names are the English names given (for now) but usually best to put the Places data should be in your language (including the words "male" first, people next, then marriages and "female")families.
Each of these can go in its own area in a spreadsheet. There is no limit to the number of areas in a sheet, and each area can have any number of rows. Leave a blank row between "areas". Just make sure that areas are not next to each other; they must be above and below one another.
You can have multiple areas of each kind on a spreadsheet. The only limitation is that if you refer to a person, you must do that in a row lower than where that person is described. Likewise, if you refer to a marriage, you must do that in a row lower than where the marriage is described. References to enclosed_by places must already exist in the database, or be defined in rows above in the spreadsheet. If you use the 'grampsid' as a way to assign specific ids, be ''very'' careful when importing to a current database. Any data you enter will '''overwrite''' the data assigned to that grampsid. If you use ids in the place, person, marriage, or family columns that are surrounded by brackets (for example '[I0001]'), the values you use will be interpreted as grampsids as well. If you are adding '''new''' items, you are encouraged to avoid use of the bracket format or grampsid columns, so as to avoid accidentally overwriting your data. If you are mixing the bracket (or grampsid) methods with plain references (no brackets), put the plain referenced data after the bracket 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"
<pre>
Place, Title, Name, Type[P0001], Michigan, Michigan, StateL1, Canada, Canada, CountryL2, USA, USA, Country 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