Dear John,
thanks for your quick reply. I guess this is exactly what I need. I
don't get it running, though :/ Did I understand that correctly?
$ cat test.txt
= expr any ( account =~ /Assets:ThatBankAccount/ )
$account -0.5
2016/01/01 * test transaction
Expenses:Food $500
Assets:ThatBankAccount $-500
$ ledger -f test.txt bal
While parsing file "/media/truecrypt4/Buchhaltung.git/test.txt", line 2:
While parsing value expression:
any ( account =~ /Assets:ThatBankAccount/
While parsing automated transaction:
> = expr any ( account =~ /Assets:ThatBankAccount/ )
Error: Invalid token '<end of input>' (wanted ')')
$ ledger --version
Ledger 3.1.1-20160111, the command-line accounting tool
Thanks,
Rolf
On 08/25/2016 06:57 PM, John Wiegley wrote:
"RS" == Rolf Schröder <[email protected]> writes:
RS> So I wonder, whether I can apply my automated transaction to all postings
RS> of a transaction if any of the posting matches my automated transaction's
RS> criteria? Is there any other possible solution to my problem?
The "any" function will apply a predicate to every posting within a
transaction. So you'd write:
= expr any (account =~ /Assets:ThatBankAccount/)
$account -0.5
This will halve every posting in a transaction, if any of that transaction's
posting match the given account regexp.
--
---
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/d/optout.