gnucash xml and sqlite file format

2.3k Views Asked by At

I'm working on a simple database. For me it's the first time that I use gnucash and I must use it. When I save my database I expect a file in .xml or sqlite format but after clicking "Save As" in my save folder I see only a file in .gnucash format and .log files but not in xml or sqlite. I must manage these files in Java IDE. Is there a solution to this problem or is it possible manage directly .gnucash file format directly in Java?

1

There are 1 best solutions below

4
On BEST ANSWER

FROM: http://wiki.gnucash.org/wiki/File

How can I edit the file?

The file itself is XML data but in compressed form (compressed by the program gzip).

This is switched on or off according to the preference setting in Edit->Preferences->General where you can set or unset the checkmark at File compression. By default it is activated.

In order to have a look at your data by a text editor, you need to open a terminal window (console window) and enter the following commands:

mv foobar foobar-copy.gz
gunzip foobar-copy.gz

where you need to replace "foobar" by your actual file name, of course. After > these two commands have been entered, you can open the resulting file "foobar-copy" > in a text editor.

When you intend to make some manual changes, as we have done, make sure to have a backup of your original file somewhere in case you get something wrong. In this case, the original file, "foobar" is intact.

Once you have edited and saved the file, you don't have to gzip it yourself; GnuCash will do this upon the next save.

In short, the xml file, (And I'm speculating the sqlite file) is compressed and you need to decompress them before you can edit them. Or you can tell GNUCash to skip the compression.