Error: Only one posting with null amount allowed per transaction

58 views
Skip to first unread message

sprock

unread,
Nov 21, 2023, 1:30:27 PM11/21/23
to Ledger
Hello,

I'm getting this error:

While parsing file "/usr/home/sprock/Personal/Finances/ledger.csv", line 1:
While parsing CSV line:
  2023-11-20,Point of Sale - Interac RETAIL PURCHASE 000001553028 CIRCLE K # 252,100.54,

Error: Only one posting with null amount allowed per transaction

using this command line:
ledger convert ledger.csv --input-date-format "%Y-%m-%d" -f my.ledger

I'm new to this so please excuse me if I am being stupid.
Thanks.

John Wiegley

unread,
Nov 22, 2023, 2:44:20 PM11/22/23
to sprock, Ledger
>>>>> "s" == sprock <rma...@mun.ca> writes:

s> I'm getting this error:

s> While parsing file "/usr/home/sprock/Personal/Finances/ledger.csv", line 1:
s> While parsing CSV line:   2023-11-20,Point of Sale - Interac RETAIL
s> PURCHASE 000001553028 CIRCLE K # 252,100.54,

s> Error: Only one posting with null amount allowed per transaction

s> using this command line:
s> ledger convert ledger.csv --input-date-format "%Y-%m-%d" -f my.ledger

The convert sub-command does quite a bit of work, so it’s hard to say exactly
what’s going wrong in this scenario from the information provided.

John

Roger Mason

unread,
Nov 22, 2023, 3:23:04 PM11/22/23
to Ledger
Hello,
Thanks for your reply.

I don't know what information you need but this is the top few lines of
the CSV file:

date,description,debit,credit
2023-11-20,"Point of Sale - Interac RETAIL PURCHASE 000001553028 CIRCLE K # 252",100.54,
2023-11-20,Point of Sale - Interac RETAIL PURCHASE 000001671085 SOBEYS #590,3.00,
2023-11-20,Point of Sale - Interac RETAIL PURCHASE 332310187408 DOLLARAMA #1440,50.60,

The failure occurs at line 1.

The target journal (my.ledger) exists but is empty. I have also tried
the convert command with my.ledger containing this:

2023-01-01 Opening Balance
Assets:Checking 342.63
Equity:Opening Balances

and getting the same error.

I am using ledger-3.2.1 on FreeBSD 12.4.

Please let me know if you need further information.

Thanks,
Roger

John Wiegley

unread,
Nov 22, 2023, 4:11:25 PM11/22/23
to Roger Mason, Ledger
>>>>> "RM" == Roger Mason <rma...@mun.ca> writes:

RM> I don't know what information you need but this is the top few lines of
RM> the CSV file:

RM> date,description,debit,credit
RM> 2023-11-20,"Point of Sale - Interac RETAIL PURCHASE 000001553028 CIRCLE K # 252",100.54,
RM> 2023-11-20,Point of Sale - Interac RETAIL PURCHASE 000001671085 SOBEYS #590,3.00,
RM> 2023-11-20,Point of Sale - Interac RETAIL PURCHASE 332310187408 DOLLARAMA #1440,50.60,

When I create a file containing these lines, and run “ledger convert” on it,
it outputs the following:

Vulcan ~/dl $ ledger convert foo.dat
2023/11/20 * Point of Sale - Interac RETAIL PURCHASE 000001553028 CIRCLE K # 252
Expenses:Unknown $-100.54
Equity:Unknown

2023/11/20 * Point of Sale - Interac RETAIL PURCHASE 000001671085 SOBEYS #590
Expenses:Unknown $-3.00
Equity:Unknown

2023/11/20 * Point of Sale - Interac RETAIL PURCHASE 332310187408 DOLLARAMA #1440
Expenses:Unknown $-50.60
Equity:Unknown

Is there anything more I need to reproduce the error?

John

Roger Mason

unread,
Nov 22, 2023, 4:51:37 PM11/22/23
to Ledger

"John Wiegley" <jwie...@gmail.com> writes:

>>>>>> "RM" == Roger Mason <rma...@mun.ca> writes:
>
> RM> I don't know what information you need but this is the top few lines of
> RM> the CSV file:
>
> RM> date,description,debit,credit
> RM> 2023-11-20,"Point of Sale - Interac RETAIL PURCHASE 000001553028 CIRCLE K # 252",100.54,
> RM> 2023-11-20,Point of Sale - Interac RETAIL PURCHASE 000001671085 SOBEYS #590,3.00,
> RM> 2023-11-20,Point of Sale - Interac RETAIL PURCHASE 332310187408 DOLLARAMA #1440,50.60,
>
> When I create a file containing these lines, and run “ledger convert” on it,
> it outputs the following:
>
> Vulcan ~/dl $ ledger convert foo.dat

If I run 'ledger convert foo.csv' the response is:

Error: No journal file was specified (please use -f)

so I run:

ledger convert foo.csv -f my.ledger

and get the error above.

If I run:

ledger convert foo.csv -f ./my.ledger

I get: Error: Cannot read journal file "/usr/home/rmason/Personal/Finances/PlainText/foo.csv"

Thanks again,

Roger

John Wiegley

unread,
Nov 27, 2023, 3:46:18 PM11/27/23
to Roger Mason, Ledger
>>>>> "RM" == Roger Mason <rma...@mun.ca> writes:

RM> If I run:

RM> ledger convert foo.csv -f ./my.ledger

RM> I get: Error: Cannot read journal file
RM> "/usr/home/rmason/Personal/Finances/PlainText/foo.csv"

Can you try with absolute paths for both files?

John

Roger Mason

unread,
Nov 30, 2023, 7:12:11 AM11/30/23
to Ledger
Hello,

"John Wiegley" <jwie...@gmail.com> writes:

>
> Can you try with absolute paths for both files?
>
> John

ledger convert /home/rmason/Personal/Finances/PlainText/foo.csv
Error: No journal file was specified (please use -f)

ledger convert /home/rmason/Personal/Finances/PlainText/foo.csv -f /home/rmason/Personal/Finances/PlainText/my.ledger
Error: Cannot read journal file
"/home/rmason/Personal/Finances/PlainText/my.ledger"

touch my.ledger
ledger convert /home/rmason/Personal/Finances/PlainText/foo.csv -f /home/rmason/Personal/Finances/PlainText/my.ledger
While parsing file "/home/rmason/Personal/Finances/PlainText/foo.csv", line 1:
While parsing CSV line:
2023-11-20,"Point of Sale - Interac RETAIL PURCHASE 000001553028 CIRCLE K # 252",100.54,

Error: Only one posting with null amount allowed per transaction

Thanks again for the help.

Roger

John Wiegley

unread,
Nov 30, 2023, 3:59:48 PM11/30/23
to Roger Mason, Ledger
>>>>> "RM" == Roger Mason <rma...@mun.ca> writes:

RM> touch my.ledger
RM> ledger convert /home/rmason/Personal/Finances/PlainText/foo.csv -f /home/rmason/Personal/Finances/PlainText/my.ledger
RM> While parsing file "/home/rmason/Personal/Finances/PlainText/foo.csv", line 1:
RM> While parsing CSV line:
RM> 2023-11-20,"Point of Sale - Interac RETAIL PURCHASE 000001553028 CIRCLE K # 252",100.54,

RM> Error: Only one posting with null amount allowed per transaction

OK, now can you get me a small enough file that reproduces this issue so that
I can manifest the error on my side?

Thanks,
John

Roger Mason

unread,
Dec 1, 2023, 8:30:34 AM12/1/23
to Ledger
Hello,

"John Wiegley" <jwie...@gmail.com> writes:

> OK, now can you get me a small enough file that reproduces this issue so that
> I can manifest the error on my side?

This one-line CSV file triggers the problem.

foo.csv
Reply all
Reply to author
Forward
0 new messages