quentinsf / icsv2ledger

Interactive importing of CSV files to Ledger
196 stars 70 forks source link

metadata values inlined on a single line, without separator #103

Closed zacchiro closed 7 years ago

zacchiro commented 7 years ago

I recently updated to the current HEAD of icsv2ledger, and tags formatting no longer works properly for me. I'm using the following template:

{date} {cleared_character} {payee}
    ; Label: {addon_label}
    {tags}
    {debit_account:<35}    {debit:>9} {debit_currency}
    {credit_account:<35}    {credit:>9} {credit_currency}

And when multiple tags are associated to a transaction, I get entries like this:

2017-04-19 * train ticket
    ; Label: some stuff that looks OK
    ; Author: Person1Card: 12345678X-Payee: RATP
    Expenses:Transport:Train
    Assets:Cmut:Checking                      -10.00 EUR

The actual tags I entered in icsv2ledger here are "Author", "Card", and "X-Payee"; all are actually metadata values. Note the lack of spacing between tags on line 3.

I see two issues here:

  1. metadata values (as opposed to tags) should be on separate lines to be valid (AFAICT from the ledger manual)
  2. either way, when tags are on a single line, they should be separated to avoid creating spurious tags that do not correspond to what you entered in icsv2ledger