From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sEMiNcGN9F+7RQAA0tVLHw (envelope-from ) for ; Tue, 05 Jan 2021 16:03:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id cMELMcGN9F+mIAAA1q6Kng (envelope-from ) for ; Tue, 05 Jan 2021 16:03:13 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6081E94043A for ; Tue, 5 Jan 2021 16:03:13 +0000 (UTC) Received: from localhost ([::1]:53530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwong-0008Bf-5W for larch@yhetil.org; Tue, 05 Jan 2021 11:03:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwomv-00089t-UB for emacs-orgmode@gnu.org; Tue, 05 Jan 2021 11:02:25 -0500 Received: from ciao.gmane.io ([116.202.254.214]:32844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwomu-0007Mj-9y for emacs-orgmode@gnu.org; Tue, 05 Jan 2021 11:02:25 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kwoms-0006EJ-D3 for emacs-orgmode@gnu.org; Tue, 05 Jan 2021 17:02:22 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-orgmode@gnu.org To: emacs-orgmode@gnu.org From: Uwe Brauer Subject: [A solution of sorts] (was: accounting) Date: Tue, 05 Jan 2021 17:02:13 +0100 Message-ID: <87sg7f1iey.fsf_-_@mat.ucm.es> References: <87ble56q1j.fsf@mat.ucm.es> <87o8i5t35l.fsf@web.de> <87eej06ff0.fsf@mat.ucm.es> <87k0ssls43.fsf@ucl.ac.uk> <8735zg5v5u.fsf@mat.ucm.es> <87r1mzkb7u.fsf@disroot.org> <878s972y8l.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cancel-Lock: sha1:9L947Mdyz2W3SdJpjG3jIjPYGzY= Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.74 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=mat.ucm.es (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 6081E94043A X-Spam-Score: -1.74 X-Migadu-Scanner: scn0.migadu.com X-TUID: mFnBG/ra2RFo >>> "UB" == Uwe Brauer writes: >> On Monday, 4 Jan 2021 at 21:01, Uwe Brauer wrote: >> Yes. >> Sorry I was brief: I cut and pasted something from one of my files while >> in a rush! >> Basically, you could do: >> #+begin_src ledger :cmdline -V --format "%-20A %14T\n" bal --flat assets >> 2010/01/01 * Starting balance >> assets:bank:savings 1300.00 >> income:starting balances >> 2010/07/22 * Got paid >> assets:bank:chequing 1000.00 >> income:salary >> #+end_src >> and you would get, as output, > But I rather prefer to have > | 340 | expenses | | | > | 170 | | BigBrother | | > | 150 | | | Jacket | > | 20 | | | Shoes | > | 170 | | Brother | | > | 130 | | | BigBrother | > | 40 | | | ChristmasTree | > | -340 | income | | | > | -170 | | BigBrother:Card | | > | -170 | | Brother:Card | | > | | | | | > |------+----------+-----------------+---------------| > | 0 | | | | > Any idea how to achieve this? Well 10 years ago Eric Schulte posted this https://lists.gnu.org/archive/html/emacs-orgmode/2010-08/msg00502.html #+name: test #+begin_src ledger 2010/01/01 * Starting balance assets:bank:savings 0 income:starting balances 2010/07/23 ChristmasTree expenses:Brother:ChristmasTree 40.00 income:Brother:Card 2010/07/24 Jacket expenses:BigBrother:Jacket 150.00 income:BigBrother:Card 2010/07/24 Schuhe expenses:BigBrother:Shoes 20 income:BigBrother:Card 2010/07/23 BigBrother expenses:Brother:BigBrother 130 income:Brother:Card #+end_src #+begin_src emacs-lisp :var ledger=test (with-temp-buffer (insert ledger) (message ledger) (org-table-convert-region (point-min) (point-max) 2) (org-table-to-lisp)) #+end_src #+RESULTS: | 340 | expenses | | 170 | BigBrother | | 150 | Jacket | | 20 | Shoes | | 170 | Brother | | 130 | BigBrother | | 40 | ChristmasTree | | -340 | income | | -170 | BigBrother:Card | | -170 | Brother:Card | | -------------------- | | | 0 | | It is not precisely what I want, but not bad either. If somebody can come up with a better solution.......