Hi Oleg, You can specify your own formats for both the balance and register reports. See the docs for output customization[1] and formatting codes[2]. I use a custom format when loading data into my sql reporting database which is effectively the CSV output plus a bunch of fields. You can see the register format I use in the source for ledger-web[3].
[1]: http://www.ledger-cli.org/3.0/doc/ledger3.html#Output-Customization [2]: http://www.ledger-cli.org/3.0/doc/ledger3.html#Formatting-codes [3]: https://github.com/peterkeen/ledger-web/blob/master/lib/ledger_web/config.rb#L100 --Pete On Sun, May 12, 2013 at 1:54 AM, oleg dashevskii <[email protected]>wrote: > Hi, > > having been a proud user of ledger+vim+custom shell scripts combo for a > long time, I want to integrate ledger into some bigger system now. Another > program would generate transactions, save them into a file consumable by > ledger, run "balance" or "register" commands and parse the report. > > The question is what's the best way to do that. 3.0 docs describe XML > format, but I couldn't make "xml" command work (besides, does XML support > metadata?). Still, input data can be put into a text file. What concerns me > more is output of "balance" and "register". The normal ledger output is > custom-tailored to fit screen width, some account names are presented in a > compact way, etc. This presents a problem for parsing, since parser must > identify the exact account name. > > So, how can I solve this problem? Can XML (or CSV which is also mentioned > in the docs) be used for input and output? Or, are there any flags which > make ledger output more machine-readable? > > -- > Oleg. > > -- > > --- > You received this message because you are subscribed to the Google Groups > "Ledger" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- --- You received this message because you are subscribed to the Google Groups "Ledger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
