o1bigtenor <[email protected]> writes:

> My record keeping system is a little complex and I have lots of levels
> of sub-accounts. As I'm doing my 'do the taxes trick' life would be
> quite a bit simpler if I could total the amounts in all the levels of
> sub-accounts under a particular account.
> 
> Now 9795.00.66.01 is a sub-account in a group that starts at
> 9795.00.00.00 (The major sub-account) and runs to 9795.00.98.50 with
> presently 57 sub-accounts.
>
> Is there some way to ask ledger to print and sum all the transactions
> from 9795.00.00.00 to 9795.00.98.50?

The best way I know to do this would be to use the --limit flag with an
expression that matches just the accounts you want to sum.

I don't know that ledger has a good way of treating account names as
numbers inside an expression, and I suspect that you will end up
fighting with ledger a lot if your accounts tree is based on assuming
that it can.

But at least in this case you can fake it with regexps:

ledger reg --limit 'account =~ /9795\.00\.[0-9][0-8]\.(([0-4][0-9])|50)/'

Hope that helps!

-- 
Best,
Richard

-- 

--- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/87zhfk8irx.fsf%40aquinas.

Reply via email to