I found the reason. I was following the last version of the manual, which has "credit" and "debit" fields in CVS parser. But I am using ledger-3.1.3, which had "amount" field only. I see src/cvs.h changed in newer versions.
My problem is fixed. Hopefully this helps someone else with the same problem :) BR Carlos El lun, 10 abr 2023 a las 13:28, Carlos Sánchez de La Lama (<[email protected]>) escribió: > > Hi all, > > I am trying to follow the steps in the manual > (https://ledger-cli.org/doc/ledger3.html#The-convert-command) to > import CSV data into my journal. But I am getting different errors. > > I have reduced my test case to a simple almost empty journal: > > 2022/12/01 * Opening Balance > Assets:MyBank 3117.82 > Equity:Opening Balances > > And a simple CSV taken from the examples in the manual: > > ,date,payee,note,debit,credit,balance,code, > 767406,12/13/2022,"Deposit","CASH DEPOSIT",,45.00,00001646.89,, > 767718,12/13/2022,"Withdrawal","ACE HARDWARE 16335 S HOUGHTON > RD",8.80,,00001640.04,, > > But I am getting an error: > LANG=C ~/src/ledger/ledger convert test.csv --input-date-format > "%m/%d/%Y" --invert --account Assets:MyBank --rich-data --file > test.dat --now=2023/01/13 > > While parsing file "test.csv", line 1: > While parsing CSV line: > 767406,12/13/2022,"Deposit","CASH DEPOSIT",,45.00,00001646.89,, > > Error: Cannot negate an uninitialized amount > Without the --invert flag, the error changes: > > Error: Only one posting with null amount allowed per transaction > > What am I doing wrong? > > Thanks, > > Carlos -- --- You received this message because you are subscribed to the Google Groups "Ledger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ledger-cli/CA%2BKcR8Bkaap0qApqAi%3DGRQ9z5HDdi1%3D7JoaYiTG5oRnPVSOETQ%40mail.gmail.com.
