Importation et Exportion CSV

From Gramps
Jump to: navigation, search
Gnome-important.png Notice spéciale pour le droit à la copie: Toutes les éditions de cette page ont besoin des deux différentes licences pour la réutilisation:

Ces licences permettent au projet Gramps de maximiser l'utilisation du manuel wiki en tant que contenu libre pour les prochaines versions de Gramps. Si vous êtes en désaccord avec cette double licence, alors n'éditez pas cette page. Vous pouvez ajouter un lien pour cette page, ce dernier sera sous licence GFDL via le lien externe (utilisant la syntaxe: [http://www.gramps-project.org/...]), et non via les liens internes.<br\> Utilisez également les conventions typographiques.


Précédent Index Suivant
Gramps-notes.png

Ébauche

À compléter !

Si vous pouvez aider à la traduction ou l'adapter à la culture francophone.

N'hésitez pas à améliorer cette page.

Importation/Exportation du tableur Gramps

Ce format vous permet d'importer et d'exporter une table avec des données en une seule fois. La table doit être dans un format séparé par des virgules (CSV). La plupart des programmes type tableur peuvent lire et écrire ce format. Il est également simple de l'éditer à la main. C'est le seul format d'importation Gramps qui permet la fusion des données existantes.

Gnome-important.png
Note

Ce format de table ne permet pas d'exporter 100% export des données Gramps. Il ne fait qu'exporter (et importer) un ensemble de données, type : individus (nom et genre), naissance, baptême , décès, et inhumation dates/lieux/sources, mariages (dates/lieux/sources) et relations (parents et enfants). Les notes ne sont pas exportées, mais de nouvelles notes peuvent être ajoutées à la fin de notes existantes.

Les sources sont référencées par leur texte du titre. Vous pouvez ajouter des détails supplémentaires à une nouvelle source après l'importation.

Il y a trois utilisations principales pour ce format :

  1. Vous pouvez exporter vos principales données Gramps dans un format type tableur, éditer le texte ou utiliser une programme type tableur, et importer les changements et ajouts dans Gramps. This is handy for sending to others to fill in, or for taking on the road when you don't have your full gramps application.
  2. Vous pouvez importer de nouvelles données dans une base de données Gramps. Par exemple, if you have a set of new people to add to your database, but don't want to hunt and peck your way to finding where they go, you might find it easier to type them into a spreadsheet, and then quickly suck all of them in at once. This is handy if you have a large amount of data that you are cutting and pasting from another application or the web. Un exemple étant l'action de restaurer votre base de données en chargeant votre site internet Saga dans une table.
  3. Vous pouvez également importer un ensemble de corrections et d'ajouts. Say that you have printed out a report, and you are going through it marking corrections. If you make each correction a section of a spreadsheet, you can "script the edits" and then execute them all at once.

Exportation

Pour exporter votre base de données :

  1. Démarrez Gramps
  2. Sélectionnez "Exporter" depuis le menu 'Arbres Familiaux'
  3. Sélectionnez le format "Tableur séparé par des virgules (CSV)"
Gramps-notes.png

Ébauche

À compléter !

Si vous pouvez aider à la traduction ou l'adapter à la culture francophone.

N'hésitez pas à améliorer cette page.

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 familes 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. Gramps 3.3 now exports source titles; previously no source data was exported.

Your data is broken up into three sections representing individuals, marriages, and children. The exported fields and column names are:

Individuals
Person, Lastname, Firstname, Callname, Suffix, Prefix, Title, Gender, Birthdate, Birthplace, Birthsource, Deathdate, Deathplace, Deathsource, Note
Marriages
Marriage, Husband, Wife, Date, Place, Source, Note
Families
Family, Child
Individuals
Person, Lastname, Firstname, Callname, Suffix, Prefix, Title, Gender, Birthdate, Birthplace, Birthsource, Baptismdate, Baptismplace, Baptismsource, Deathdate, Deathplace, Deathsource, Burialdate, Burialplace, Burialsource, Note

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 ontop of your old data and it will be corrected.

Gramps-notes.png
Open/Libre Office vous permettent de désactiver le formatage automatique quand vous ouvrez un fichier CSV.

Si vous ne le faites pas, alors Open/Libre Office peuvent mal interpréter ces dates. Changez le type de colonne pour Texte plutôt que Standard. Si votre programme de tableur ne permet pas cela (par exemple, Excel), alors vous devrez changer l'affichage du format des dates dans Gramps avant d'exporter vos données. Vous pouvez le faire depuis le menu Éditer -> Préférences -> Affichage -> Format de date.

Importation

To import your data:

  1. use the file from above, or create a spreadsheet (described below) with genealogical data
  2. start up gramps
  3. import the file into your current database

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.

If you load this spreadsheet into Libre Office, make sure you select each column as type Text rather than Standard. Standard will reformat your dates and numbers. Also, if you use Excel, you will probably want to select all cells once opened, and change the format of the cells to Text.

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:

Individus

person -  une référence à utiliser pour les familles (mariages, et enfants) 
grampsid - pour assigner un identifiant id Gramps à l'individu
firstname - le prénom de l'individu
surname/lastname - le nom de famille de l'individu
callname - un nom commun, usuel (ou surnom) pour l'individu
prefix - le préfixe du nom de famille (von, de, etc)
suffix - le suffixe (Jr., Sr.)
title - le titre de l'individu (Dr., Mr.)
gender - masculin ou féminin (vous devez utiliser votre traduction)
note - une note pour l'enregistrement de cet individu
birthdate - date of birth
birthplace - place of birth
birthsource - source title for birth
grampsid - give a particular gramps id
deathdate - date of death
deathplace - place of death
deathsource - source title for death
deathcause - cause of death
baptismdate - date of baptism
baptismplace - place of baptism
baptismsource - source title of baptism
burialdate - date of burial
burialplace - place of burial
burialsource - source title of baptism

Mariage

marriage - if you want to reference this from a family, you'll need a matching name here
husband/father/parent1 - the reference of the person above who is the husband 
                         (for female parent1, you'll need to put gender in the person area, 
                         or edit it later in gramps)
wife/mother/parent2 - the reference of the person above who is the wife 
                         (for male parent2, you'll need to put gender in the person area, 
                         or edit it later in gramps)
date - the date of the marriage
place - the place of the marriage
source - source title of the marriage
note - a note about the marriage/wedding

Famille

family - a reference to tie this to a marriage above (required)
child - the reference of the person above who is a child
source - source title of the marriage
note - a note about the family
gender - male or female (you should use the translation for your language) 
         [You can put gender here, or in person above]

Détails

Case doesn't matter. Notice that the names don't use underscores in them. You may use any combination of these, in any order. (Actually, you have to at least have a surname and a given name when defining a person, and you have to have a marriage and child columns when defining children, 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").

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 mutiple 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.

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:

marriage, person1, person2, place
m1, p1, p2,"Clinton, Co., MO"
m2, p3, p4,"Havertown, PA"

A spreadsheet program will do this automatically for you.

Here is an example spreadsheet in Open/Libre Office, but any spreadsheet program should work.

Test-csv.jpg

Notice that the data need not begin in the first column, nor in the first row.

And here is the resulting data in gramps:

Screenshot-1.jpg

Here is an example of a CSV text spreadsheet with multiple areas:

Firstname, Surname, Birthdate
John,      Tester,  11/11/1965
Sally,     Tester,  01/26/1973

Person, Firstname, Surname
p1,     Tom,       Smith
p2,     Mary,      Jones
p3,     Jonnie,    Smith
p5,     James,     Loucher
p6,     Penny,     Armbruster
p7,     Tim,       Sparklet

Marriage, Husband, Wife
m1,       p1,      p2
m2,       p5,      p6

Family, Child
m1,     p3
m1,     p6
m2,     p7

If you cut and paste that into a file, you can import it directly.

If you make your references be gramps IDs inside square brackets, then you can refer to people already in the database, like this:

Person,    Firstname, Lastname
joe's boy, Harry,     Smith

Family,  Child
[F1524], joe's boy

Husband, Wife
[I0123], [I0562]

firstname, surname
Timothy, Jones

This example would create and add Harry Smith to the previously existing family in gramps, family F1524.

Also, this example would marry two previously existing people, I0123, and I0562.

Finally, this also creates a person named Timothy Jones who is not related to anyone.

Exemple du monde réel

In this example, I had an entire generation to enter, 16 names with marriage dates. The children I already had in the database. I entered them into Libre Office:

Gen5-spreadsheet.jpg

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.

ATTENTION

Open/Libre Office allows you to turn off autoformatting when you open the CSV file. If you don't do this, Open/Libre Office 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 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.

Saving as CSV and importing into gramps produces the far right-hand column in the tree:

Gen5-gramps.jpg


Précédent Index Suivant