This can be done with the Export to CSV and a little work in Excel or other spreadsheets…
If you need to clean up a flat structured place list to a Gramps hierarchial structure, that can be done either by using the excelent tool of OpenRefine openrefine.org (there are a long discussion about how to do it in the sourceofrge mailing list, i think it was in october/november and december 2019…
It will also be possible with formulas in Excel or other spreadsheet software… OR you can use the unbelievable Power Query tool in Excel 2016 -> (it can be downloaded for some older versions).
The thing you need to be aware of is to keep the original “Place” field for the place lowest in the hierachy, and create some custom Place “codes” for the higher levels placenames…
i.e.:
if you have New York City, NY, USA as Place P0001, and you would like this to be in a hierachy list fixed in either OpenRefine or in a spreadsheet, then you will need to add a row for NY State, and a row for USA… and give each of thos new rows a new “Place code” i.e. P0002 for NY State and P0003 for USA…
There was some problems with this, that Gramps need a sorted list, but that has been fixed, and I also think the fix has been added to the latest version of Gramps, if not, the fix is mentioned in the sourceforge maillist thread about this topic…
Its important that you use latest version of Gramps when exporting/importing the CSV list…
To get the correct format for the CSV list, just do an export of a single place, then create a table of it Excel (it will be easier to work with if you want to create formulas for extracting placenames for different sheets/workbooks…
I recommend using Power Query or OpenRefine for this job, if you have a lot of place name in flat format styles formated as a comma delimited list…
I have not found anything like Power Query in LibreOffice or OpenOffice, so if you only run Linux, OpenRefine will be the best choice I think… and with OpenRefine, you can also Reconcile data in your table with data from other tables and service providers.
And when using Power Query or OpenRefine, you can batch add Dates, Types and other values as you need to…
Its still a lot of work, but not as much as if you should do it all manually…
When you import the Edited CSV with all you hierachial data back to Gramps, all places with the PlaceID will be updated and places with ID’s not in Gramps will be created…
Please remember to do all this work on a test database !
You will most likely have to do the import/export a lot of times untill you have the data like you want it…
I have created one csv with more than 80000 places this way, and I have multple CSV files that I am about to merge to one table of more than 800000 placenames…
It should also work with alternative names if you use the date field and the same ID for all names, but I have not done any extended testing on that…
Just remember, the original place need to keep the original placeid unaltered, else it will be created as a new place…
You will need to use a few hours learning the work of OpenRefine, but take a look at the different tutorials they have and it should not be a big problem to do the work, only time consuming…
And done right, you will not have to merge any places in Gramps, it should be automated by the import.
Ooh… and one more thing… the placeID must be identical each place in each of the databases you import, else some of them might be overwritten or you end up with multiple identical placenames…
So this job must be done on each of the databases and the PlaceID must be “IN SYNC” if you don’t want to overwrite or get multiple entries in the resulting database…
i.e. if you have NY City in Both databases, the PlaceID must be the same in both databases to be able to merge them…
If you in the import has Philly with the ID of NY City in your target database, NY City wil be overwritten…
(If this behavior has not been changed lately, I know I screw up my own import a few times in the beginning because of that…)
If anyone have any other experience about this behavior, place correct me, its a long time since I last did an import where PlaceId had different Place Names vs. the target database