BeanHub-Cli 1.4.2 now supports account and currency rename

80 views
Skip to first unread message

Fang-Pen Lin

unread,
Nov 23, 2024, 6:34:42 AM11/23/24
to Beancount
As a heavy Beancount user myself, I always wanted a simple command line to rename an account or a currency name in all files at once. Certainly, the text editing tool search and replace feature could help, but from time to time, there will be a name that happens to be a substring of another unrelative string (such as Assets:Cash and Assets:Cash:WindFall), making massive renaming a bit more annoying.

I have built this functionality for BeanHub previously, but because it's super useful, I have always wanted to bring it to our open-sourced command line tool, beanhub-cli. Today, I finally found the time to do it. With the new release 1.4.2, you can do this to run format with renaming account and currency as a side effect:

bh format \
    -ra Assets:Cash Assets:Cash:Wallet \
    -ra Expenses:Food Expenses:Dining \
    -rc BITCOIN BTC \
    -rc ETHER ETH

You can find the repo here:


and the doc for format here:

https://beanhub-cli-docs.beanhub.io/commands/format/

Hope this can be helpful to some 😄

Martin Blais

unread,
Nov 23, 2024, 3:12:28 PM11/23/24
to bean...@googlegroups.com
Thanks for sharing!
Also: xx-rename goes a long way to solving this (from https://github.com/blais/xxdiff)

--
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 beancount+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/beancount/5d71956a-710d-4e4c-9883-6b2155d59d9dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages