Please do NOT post requests for help here. Use the Help forum for that.

TOPIC: [SOLVED] Leading zeros in ID

Leading zeros in ID 5 months 1 week ago #1

  • Erik Bachmann
  • Erik Bachmann's Avatar
  • Offline
  • New
  • Posts: 17
My GEDCOM data has been put through various genealogy software over the years.
Some of these solutions has prefered leading zeros in ID's and some don't.
This means that individual I1 and I000001 is not the same.

How can I align these ID's?
Can I force webtrees to use a specific number of digits in the ID?

The ID's with leading zeros are used in various photo albums and document collections (I'm talking 10K+ references) - and I would like to have ID normalized.
---
{ö} Erik Bachmann
{ö} Erik Bachmann
The administrator has disabled public write access.

Leading zeros in ID 5 months 1 week ago #2

  • norwegian_sardines
  • norwegian_sardines's Avatar
  • Offline
  • Gold
  • Posts: 1400
I cant help you with "normalizing" the XREF except to say that you could export the GEDCOM and write a "Change all" routine or replace that changes all "I0" to "I". Then Import the GEDCOM into a new tree. This way if you mess up your old tree is not lost.

In reality you should not use any XREF for anything external to the GEDCOM database. An XREF is not an "ID" to be used in this manor.

I recommend using creating a REFN relationship from your GEDCOM to your external files and documents. This is what I do. Theoretically an XREF can change at any time during a GEDCOM load or unload, GEDCOM does not guarantee that the XREF value will survive an import or export. In most cases it will but it does not have to.
Ken
Last Edit: 5 months 1 week ago by norwegian_sardines.
The administrator has disabled public write access.

Leading zeros in ID 5 months 1 week ago #3

  • bertkoor
  • bertkoor's Avatar
  • Offline
  • Gold
  • Greetings from Utrecht, Holland
  • Posts: 1192
Google for "gedcom renumber" and you'll find some utilities that supposedly are up to the job.
stamboom.BertKoor.nl runs on webtrees v1.7.9
The administrator has disabled public write access.

Leading zeros in ID 5 months 1 week ago #4

  • Erik Bachmann
  • Erik Bachmann's Avatar
  • Offline
  • New
  • Posts: 17
OK - I gather that webtrees cannot insert leading zeros in the ID's? That's a pity. This could fix other problems like sorting individuals by ID.

Well - I'll update the `wt_next_id` to a count higher than all the two highest ID's
0 @I002989@ INDI
+ 'next_id' FROM `wt_next_id`
and run a renumber on the GEDCOM

I've looked at various renumber application - and frankly - I don't trust them. I'll experiment with some regexp in an editor instead
{ö} Erik Bachmann
The administrator has disabled public write access.

[SOLVED] Leading zeros in ID 5 months 1 week ago #5

  • Erik Bachmann
  • Erik Bachmann's Avatar
  • Offline
  • New
  • Posts: 17
Problem solved.
{ö} Erik Bachmann
The administrator has disabled public write access.

[SOLVED] Leading zeros in ID 5 months 1 week ago #6

  • norwegian_sardines
  • norwegian_sardines's Avatar
  • Offline
  • Gold
  • Posts: 1400
Erik said:
That's a pity. This could fix other problems like sorting individuals by ID.
Why would you want to sort by XREF, or as you call it "ID"? XREF has no lasting value in GEDCOM.
Ken
The administrator has disabled public write access.

[SOLVED] Leading zeros in ID 4 months 1 week ago #7

  • Erik Bachmann
  • Erik Bachmann's Avatar
  • Offline
  • New
  • Posts: 17
Missed this comment: I never referred to XREF . It's individual ID's like
0 @I001853@ INDI
0 @I1853@ INDI
Which are two different individuals.
The leading zeros was introduced by TNG. Nice for sorted lists in other systems.

I use these ID's in my collection of pictures, where individuals are identified by stings like:
Anne Lucie Jensdatter (01279)
Niels Hansen (01290)
stored in the IPTC field "Supplemental Categories"
Example: e-bachmann.dk/gallery/index.php?twg_albu...wg_show=alj_1890.jpg
See links to my genealogy site under map on the right hand side)

Now my data has been "on tour" through various genealogy solutions. Some of the older records have leading zeros. And the newer records made in webtrees has started a new sequence starting with 1 since numbers with leading 0.. are regarded at 0.
So now I've got two incompatible sequences. I think the the only plausible solution is to update the IDs by removing the leading zeros.
{ö} Erik Bachmann
The administrator has disabled public write access.

[SOLVED] Leading zeros in ID 4 months 1 week ago #8

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10505
> update the IDs by removing the leading zeros.

These IDs are not numbers, and you cannot simply remove the zeros.

They are text.

Record "X0001" and "X1" are *different* records.

Removing the zeros could create two records with the same ID.

Be careful.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.
Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

[SOLVED] Leading zeros in ID 4 months 1 week ago #9

  • Erik Bachmann
  • Erik Bachmann's Avatar
  • Offline
  • New
  • Posts: 17
Yep - = export `wt_individuals`+ export GEDCOM and fire up SED :-D
(I'm going to build a separate new tree to be able to check the update)
And store a new backup on a safe place :-S
{ö} Erik Bachmann
The administrator has disabled public write access.

[SOLVED] Leading zeros in ID 4 months 1 week ago #10

  • norwegian_sardines
  • norwegian_sardines's Avatar
  • Offline
  • Gold
  • Posts: 1400
Erik said:
Missed this comment: I never referred to XREF . It's individual ID's like
0 @I001853@ INDI

The @I001853@ in your example above is an XREF_ID and has the following definition:
The xref_ID is formed by any arbitrary combination of characters from the pointer_char set. The first character must be an alpha or a digit. The xref_ID is not retained in the receiving system, and it may therefore be formed from any convenient combination of identifiers from the sending system. No meaning is attributed by the receiver to any part of the xref_ID, other than its unique association with the associated record.

The keywords here are "arbitrary", "not retained in the receiving system" and "no meaning". Most genealogical software programs have no clue how to use or read the GEDCOM standard, and therefore think the XREF is a permanent "ID" but never understand that it is transient between systems. The better choice for an ID on an individual is the is the REFN tag.
Ken
The administrator has disabled public write access.
Moderators: makitso
Powered by Kunena Forum