Three ways to temporarily change a commodity symbol, eg to show "$" as "USD" in a report:
Here, we use
sed to replace all
USD in the output:
$ hledger bal | sed 's/\$/USD /g'
Most powerful. We rewrite the journal file before hledger processes it. You can merge multiple symbols into one this way, eg if inconsistent symbols have been used for a currency:
$ cat $LEDGER_FILE | sed 's/\$/USD /g' | hledger -f- bal
Most portable, requires only hledger. We create a dummy one-to-one market price between the old and new commodity symbols, and use market value reports to convert. This assumes your other market prices, if any, don't interfere.
You can add the market price in the main journal:
$ echo 'P 2000-01-01 $ 1 USD' >> $LEDGER_FILE # once $ hledger bal -V
Or in a separate file that you include only when needed:
$ echo 'P 2000-01-01 $ 1 USD' >> rewrite-symbols.j # once $ hledger bal -V -f $LEDGER_FILE -f rewrite-symbols.j