From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Org-Babel and Ledger Date: Thu, 29 Jul 2010 11:40:57 +0200 Message-ID: <87eiemsk0m.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello, I'm trying to really begin working with Ledger for my personal accounting. Of course, trying to do it with as much Org as possible... Though, results of 3 small requests (whose results is snipped, for brievety) is the following: --8<---------------cut here---------------start------------->8--- #+TITLE: Scorpios-Ledger #+LANGUAGE: en_US * Balance #+srcname: bal #+begin_src sh ledger -f scorpios-ledger.dat bal #+end_src #+results: bal | -1117.47 | EUR | Assets:Bank | | 1036.15 | EUR | Checking:FR04304429459 | | -631.62 | EUR | Savings:FR00307599427 | | -1522.0 | EUR | Transferred | | -2036.52 | EUR | Expenses | | 20.25 | EUR | Bank:Charges | | 175.09 | EUR | Insurance:House | | -2838.1 | EUR | Unknown | | 606.24 | EUR | Utilities:Electricity | | 3153.99 | EUR | Liabilities:Loans:Cecaz | | -------------------- | | | | -0.0 | EUR | | * Registry #+srcname: reg #+begin_src sh ledger -f scorpios-ledger.dat reg unknown #+end_src #+results: reg | 2009/08/21 | CHEQUE | : | 9953055 | Expenses:Unknown= | 166.7 | EUR | 166.7 | EUR | | = | | 2009/09/17 | CHEQUE | : | 7691785 | Expenses:Unknown= | 100.0 | EUR | 266.7 | EUR | | = | | 2009/10/16 | REMISE | CHEQUE | N | 86.. = | Expenses:Unknown | -525.0 | EUR | -258.3 | EUR | = | | 2009/11/06 | CHEQUE | : | 7691786 | Expenses:Unknown= | 192.0 | EUR | -66.3 | EUR | | = | | 2009/11/24 | CHEQUE | : | 7691787 | Expenses:Unknown= | 833.0 | EUR | 766.7 | EUR | | = | | 2009/11/25 | REMISE | CHEQUE | N | 92.. = | Expenses:Unknown | -970.0 | EUR | -203.3 | EUR | = | | 2009/12/31 | INTERETS | CAPITALISES | Expenses:Unknown | -8.48 = | EUR | -211.78 | EUR | | | = | | 2010/01/05 | CHEQUE | : | 7691789 | Expenses:Unknown= | 733.0 | EUR | 521.22 | EUR | | = | | 2010/01/05 | REMISE | CHEQUE | N | 93.. = | Expenses:Unknown | -525.0 | EUR | -3.78 | EUR | = | | 2010/01/14 | REMISE | CHEQUE | N | 98.. = | Expenses:Unknown | -525.0 | EUR | -528.78 | EUR | = | | 2010/01/16 | FRAIS | PRELEVEMENT | .. | Expenses:Unknown= | 10.73 | EUR | -518.05 | EUR | | = | * Reporting monthly expenses #+srcname: monthly-exp #+begin_src sh ledger -f scorpios-ledger.dat -M reg ^expenses #+end_src #+results: monthly-exp | 2009/08/01 | 0 | 2009/08/31 | Expenses:Bank:Charges | 3.05= | EUR | 3.05 | EUR | | Expenses:Unknown | 166.7 | EUR | 169.75 | EUR = | | | | | 2009/09/01 | 0 | 2009/09/30 | Expenses:Bank:Charges | 1.1 = | EUR | 170.85 | EUR | | Ex:Insurance:House | 15.9 | EUR | 186.75 | EUR = | | | | | Expenses:Unknown | 100.0 | EUR | 286.75 | EUR = | | | | | 2009/10/01 | 0 | 2009/10/31 | Expenses:Bank:Charges | 5.85= | EUR | 292.6 | EUR | | Ex:Insurance:House | 15.9 | EUR | 308.5 | EUR = | | | | | Expenses:Unknown | -525.0 | EUR | -216.5 | EUR = | | | | | Ex:Ut:Electricity | 28.38 | EUR | -188.12 | EUR = | | | | | 2009/11/01 | 0 | 2009/11/30 | Expenses:Bank:Charges | 1.1 = | EUR | -187.02 | EUR | | Ex:Insurance:House | 15.9 | EUR | -171.12 | EUR = | | | | | Expenses:Unknown | 55.0 | EUR | -116.12 | EUR = | | | | --8<---------------cut here---------------end--------------->8--- As you can see, the tables are completely wrongly made, because they're bas= ed on spaces ("=C3=A0 la Awk") and not on fixed position of fields ("=C3=A0 la= Cut"). What can I do about this? - Post-process every ledger command with some awk or cut command that will = do whatever is needed - Exploit the CSV export format (never tried, don't have Ledger 3 installed yet -- and I'm also using hledger...) - Other ideas? Do you have suggestions about the best way to go? Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode