CSV import doesn't strip whitespace #113

Closed
spang opened this Issue May 25, 2013 · 1 comment

Projects

None yet

2 participants

@spang
spang commented May 25, 2013

Trailing whitespace in fields is causing my CSV import to fail in 0.20:

➜ Downloads hledger -f Export.csv print --rules-file=~/.hledger/Export.rules
using conversion rules file /home/spang/.hledger/Export.rules
2013/01/03 ATM SURCHARGE FEE REIMBURSEMENT $-5.00
hledger: error: could not parse "$5.00 " as an amount
the CSV record is: "1098", "03/01/2013", "REV FEE", "ATM SURCHARGE FEE REIMBURSEMENT $-5.00", "", "5.00 ", "[redacted]", "", ""
the amount rule is:
the currency rule is: $
the default-currency is: unspecified
the parse error is: (line 1, column 7):
unexpected end of input
expecting "@"
you may need to change your amount, currency or default-currency rules, or add a skip rule

This didn't used to be a problem for me in 0.18 and below! This affects blank fields that have an erroneous space character between commas as well.

I know this is poor CSV formatting, but this is what my bank generates and hledger ought to be able to deal with it.

@spang
spang commented Jun 3, 2013

Thanks Simon!

@simonmichael simonmichael added the csv label May 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment