[GNC] File format question
Geert Janssens
geert.gnucash at kobaltwit.be
Wed Jan 31 15:12:57 EST 2024
Op woensdag 31 januari 2024 20:13:32 CET schreef Simon Roberts:
> Ah, excellent, thank you. I can continue with the compressed format for the
> main file and simply use zcat when needed :)
>
> The wiki description of the XML format doesn't seem to offer much, but I'm
> not worried about that, I recall from previous forays in that file that
> it's pretty self evident what's going on (at least for the purpose I have
> in mind--i.e. putting names to UUIDs).
>
> I guess the only part unresolved is whether there is anything outlining the
> log format. the single character code at column 1 seems like it might be
> important, but I'm at a loss for a guess as to what it's describing. It
> *feels* like it might explain what the numerous seemingly duplicated, and
> often zero-value, entries are about. But that's a wild stab in the dark :)
>
There's not much documentation other than the comments in the source files. The 'single
characters' you refer to are briefly explained here:
https://github.com/Gnucash/gnucash/blob/
b7e68144154c3677293148a40d66bea36d492a96/libgnucash/engine/TransLog.h#L58[1]
Though I'm not sure the behaviour is exactly like described there. I don't think a D(elete)
line is still preceded by a B(egin) line. But the meaning of the characters is still unchanged.
B for "begin edit"
C for "commit changes"
R for "rollback changes"
D for "delete"
Note these log files are call transaction logs. And that's pretty accurate. They only log
changes to transactions (and their splits). Changes to accounts or invoices or anything else
is not recorded in these logs.
Regards,
Geert
> Many thanks Glenn for very helpful pointers!
>
> Cheers,
> Simon
>
> On Wed, Jan 31, 2024 at 11:39 AM Glenn Fowler <gfowler1 at outlook.com> wrote:
> > Hi,
> >
> > Yes you have the option to compress the XML or not.
> >
> > Here is the info you are looking for:
> >
> > https://www.gnucash.org/docs/v5/C/gnucash-guide/basics-files1.html
> >
> > https://wiki.gnucash.org/wiki/GnuCash_XML_format
> > ------------------------------
> > *From:* gnucash-user <gnucash-user-bounces+gfowler1=
> > outlook.com at gnucash.org> on behalf of Simon Roberts <
> > simon at dancingcloudservices.com>
> > *Sent:* Wednesday, January 31, 2024 1:11 PM
> > *To:* Gnucash Users <gnucash-user at gnucash.org>
> > *Subject:* [GNC] File format question
> >
> > Hi all, perhaps I should be asking this on the developer's list, but I
> > figured that misdirecting here would be less disruptive / annoying than
> > miscrirecting there. Please forgive me if this is the wrong place.
> >
> > I'm investigating using logfiles as a means to identify changes that will
> > be made by my accountants for my year end. This leads me to two questions
> >
> > First, is there documentation I can look at on this topic"? I didn't find
> > anything in the user guide, but am not particularly surprised at that.
> >
> > Second, I notice that the main data file is binary. I thought it was XML
> > (perhaps that was at version 4?) But what's odder is that even if I
> > expressly request "save as XML", I still get a binary file. Is this
> > compressed, and if so, does anyone know what the compression is? I'm aware
> > that interpreting the logs will be much easier if I can correlate the
> > UUIDs
> > of the accounts (used in the logs) with the actual account info (which I
> > have previously seen in a tolerably intelligible format in the XML files
> > of
> > old).
> >
> > Any pointers / references?
> >
> > TIA
> > Simon
> >
> > --
> > Simon Roberts
> > 303 249 3613
> > https://www.youtube.com/@DancingCloudServices
> > https://www.linkedin.com/in/simonhgroberts/
> > _______________________________________________
> > gnucash-user mailing list
> > gnucash-user at gnucash.org
> > To update your subscription preferences or to unsubscribe:
> > https://lists.gnucash.org/mailman/listinfo/gnucash-user
> > -----
> > Please remember to CC this list on all your replies.
> > You can do this by using Reply-To-List or Reply-All.
--------
[1] https://github.com/Gnucash/gnucash/blob/
b7e68144154c3677293148a40d66bea36d492a96/libgnucash/engine/TransLog.h#L58
More information about the gnucash-user
mailing list