Surname corrections with Name Editor Tool

J’ai voulu utiliser le plugin Name Editor Tool du projet Isotammi mais je n’ai pas réussi a realiser

363 / 5 000

Résultats de traduction

Résultat de traduction

I wanted to use the Name Editor Tool plugin from the Isotammi project but I was unable to make the following correction on surnames: Remove the character * at the end of the name which I used to mark certain individuals with REGEX syntax Is it possible ? See attached form Beginner I am French Linux KDE Neon 6 Gramps 5.2.2

The first step is to determine if the Asterisk (“*”) has any meaning that will be lost.
(e.g., you imported the data from your sister-in-law who marked her direct Ancestor’s surnames with an Asterisk.)

You protect that meaning by Tagging these rows before removing the Asterisk.

Fortunately, you are using Gramps 5.2.2 because the following process needs two 5.2 enhancement to the CSV import:

  1. CSV dialect delimiters can be changed and now allows the Tab … which is more compatible with clipboarded data from a spreadsheet. Thanks @SNoiraud !!
  2. the CSV importer no longer replaces the Surname AND Given name if either one is specified. Now you can replace just the Surname. Thanks @dsblank !!

In the Data tab of Preferences, use the Edit… add a “Display” Name format that only shows the Surname. Then select the new “Surname” format.:

Then I went into the People (flat list) view and used the Configure to trim down the columns to just the data that would be used for a mass modification using a Spreadsheet: Name, ID and Last Changed date. (The Last Changed is included just so I can find and recheck the Rows in an unfiltered view after they are modified!)


Notice that one of the Rows doesn’t have an Asterisk displayed. In that instance, the person (Garner von Zieliński) has an Alternative Name with an asterisk. And since that is a Multiple Surname that ALSO as a prefix, this is an important name to edit manually.

But the trimmed down number of columns makes it easier to manage in an exported CSV table.

Now use the Family Trees → Export View… to export a CSV file (which uses Tabs instead of commas as delimiters because of my CSV dialect choices) that can be imported into a spreadsheet tool… like LibreCalc or Excel.

In the spreadsheet, replacing the Asterisk is just a Search&Replace all of the asterisk with a blank.

It is good to delete that problematic “Garner von Zieliński” and rename the column titles with what the import expects: “Name” should be “Surname” and “ID” should be Person.

Finally, since I want to UPDATE the records during the Import rather than create new records, the ID needs to be wrapped in square brackets. That could be done with a string concatenation formula. But it is easier to just a formatting option for the data in the spreadsheet. So I select the cells with an ID and set the Format Code to put the brackets around the @ (“At” symbol ‘text value’) placeholder: "["@"]"

Now just copy the cells with the updates (including the headers) to the OS clipboard.

And paste into the Import Text addon gramplet and click the Import button.

Thank you for this suggestion
But I didn’t necessarily want to use the csv format
I thought that the Name Editor Tool plugin through its form above would dynamically reproduce the following manual procedure which turned out to be conclusive:

.TEST test tree (with * at the end of the last name on a certain number of individuals)
.Export in xml ---->TEST.gramps
.Unzipping: gunzip <TEST.gramps >TEST.xml
.kate text editor use Regex:
Search: (<surname>.+)[*]
Replace: \1
Unless I’m mistaken: Search for the character strings following the tag up to the character *
The braces (…) defines a capture n°1 which will be used as a replacement string
. Save as MODIF.xml
.Zipping: gzip <MODIF.xml >MODIF.gramps
.Open the MODIF.gramps file with Gramps
.Corrected MODIF tree is created

I do not see that capability in the description.

The CSV workflow will work.

Or you could write a script in SuperTool.

I just found the right solution to use the Name Editor Tool plugin
It was necessary to repeat the Pattern in the right panel
And the replacement is done correctly with possibility of rollback

1 Like