piecash
piecash copied to clipboard
Ledger export format error
It seems that some records do not have proper format
2021-08-27 Buy 1 x COST211015C00435000 @ 4.73
* Assets:Investments:IBKR Uxxxxxxx:US:USD USD -2,038.00
Assets:Investments:IBKR Uxxxxxxx:US:USD USD -0.70
Expenses:Brokerage:IB:USD USD 0.70
Assets:Investments:IBKR Uxxxxxxx:US:COST211015C00435000 COST211015C00435000 100.0000 @@ USD 2,038.00
rejected by ledger-cli with this error:
While parsing file "gnucash.ledger", line 117651:
While parsing posting:
Assets:Investments:IBKR Uxxxxxxx:US:COST211015C00435000 COST211015C00435000 100.0000 @@ USD 2,038.00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unexpected char 'C' (Note: inline math requires parentheses)
I receive similar errors. I believe it is a result of the fact that ledger-cli is much more restrictive about how commodities can be named than GnuCash. Commodity names with spaces, full stops, dashes or numbers appear to generate errors in ledger-cli.
https://ledger-cli.org/doc/ledger3.html#Naming-Commodities
Commodity names can have any character, including white-space. However, if you include white-space or numeric characters, the commodity name must be enclosed in double quotes ‘"’: