On Tuesday, October 1, 2019 at 3:33:37 PM UTC+7, Oon-Ee Ng wrote:

> Is there a way to script an auto-balance? Something as simple as "Find the 
> balances of this list of accounts and insert a balance statement for all of 
> them on date X"?
>

Maybe I'm not understanding what you're asking for but isn't this just (in 
pseudo bash-code, since I don't actually remember how bash arrays work)

DATE=$1
ACCOUNTS=(Assets:US:Checking Assets:US:Savings)
for ACCOUNT in $ACCOUNTS
  BALANCE=$(bean-query my.beancount "balances at units from close on $DATE 
where account = '$ACCOUNT'" | tail -1)
  echo $DATE $BALANCE
end

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" 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/beancount/dafd0a8f-ac01-4847-947f-a1f152bee73a%40googlegroups.com.

Reply via email to