Command line to dump data as plain text files

Sébastien de Menten sdementen at gmail.com
Sun Apr 16 13:39:54 EDT 2017


Hello Cheer

You can find an example of script that dumps the content of a gnucash book
in the Ledger format at
https://github.com/sdementen/piecash/blob/master/scripts/piecash_ledger.py.
Your gnucash book should be saved in a SQL format (not XML).

Kr

Sébastien

On Apr 16, 2017 16:51, "John Ralls" <jralls at ceridwen.us> wrote:

>
> > On Apr 13, 2017, at 7:52 AM, CY Lim <cheeyee.lim at gmail.com> wrote:
> >
> > Hello all,
> >
> > I cannot seem to find how to use command line to dump data from GnuCash
> > into a single or multiple plain text files (e.g. csv). Any suggestion
> will
> > be helpful.
> >
> > If that cannot be done with command line, I am happy to use API provided
> in
> > C or Python to access the data. Some examples or documentations are
> > appreciated.
> >
> > I want to avoid manual parsing of the files, unless what I need is not
> > doable with the 2 methods above.
>
>
> There is no export facility available from the command line, and only
> limited export (of transactions and splits to csv) from the GUI. You can of
> course get to any data you want from C and to most of it from Python, and
> there's also https://github.com/sdementen/piecash <
> https://github.com/sdementen/piecash>, a third-party framework for
> working with the XML file. But...
>
> GnuCash uses by default a plain text file in XML, though it may be
> compressed with gzip. You can turn off compression in Preferences, on the
> General tab, or you can gunzip the file; GnuCash doesn't care about
> compression at load time. The not-default storage is in SQL with one of
> SQLite3, MySQL, and PostrgresQL. Most people who want to query their
> GnuCash data outside of GnuCash find that to be the easiest way.
>
> Regards,
> John Ralls
>
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> 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.
>


More information about the gnucash-user mailing list