[GNC] GUID Register Codes

Adrien Monteleone adrien.monteleone at lusfiber.net
Fri Dec 29 23:07:56 EST 2023


That's how I would do it with the XML backend too.

If you are crafty with scripts, you can likely create a table/file, 
mapping the account names to GUIDs for future reference.

or,

Switch to one of the SQL backends and write a query, or just examine the 
"accounts" table directly. Of course, in this case, you have the added 
complication that only the end leaf account names are saved in plain 
text. But the 'parent GUID' is also stored, so it is possible to sort 
out similarly named accounts.

*note, while there are many ways to view the tables in one of the SQL 
backends, an easy one is to use the SQLite manager plugin for Firefox 
with the SQLite3 backend. (it is an older type plugin, so I keep a copy 
of Waterfox Classic around to use it.)

Regards,
Adrien

On 12/29/23 6:56 PM, Jim DeLaHunt wrote:
> Stephen:
> 
> I can't answer your question fully, but I can give you some insight.
> 
> "GUID" stands for "Globally Unique Identifier". Each GUID is a large 
> number, which is generated in such a way that it is highly likely to be 
> different than any other GUID generated on any computer at any time 
> according to the same rules. On the other hand, the same GUID value 
> might show up in multiple places. Sometimes software developers generate 
> a GUID and embed it their code, so that everyone gets a copy of the same 
> GUID value. Another name for GUID is UUID, meaning "Universally" instead 
> of "Globally".
> 
> GUIDs are written to SQL databases, but they are not a creature of SQL. 
> GnuCash also generates them when the book file is stored in XML form (as 
> a ".gnucash" file).   And, because they are globally unique, it is 
> likely that your book contains different GUIDs than anybody else's book. 
> Each account has a GUID associated, but there is no reason to believe 
> that anyone else will have the same GUIDs for their accounts as you have 
> for yours.
> 
> I don't have an easy way to find out which GUID corresponds what account 
> or other object. My way of doing that is to save my book as an XML file, 
> open the file with a text editor, and search for the GUID value. 
> Somewhere in the file will be data which defines the account, and it 
> will include the GUID value and account name in close proximity. But 
> that may or may not be the best way for you to proceed.



More information about the gnucash-user mailing list