Comma used to delimit fields, and then also used in 4+ digit values

25 views
Skip to first unread message

Lisa's unattended mail

unread,
Aug 11, 2012, 5:40:43 AM8/11/12
to ledge...@googlegroups.com
Why would ledger choose a delimiter that is also used in the output
data? E.g.

$ ledger --file accounts.gnucash\
--register-format "%D,%P,%t\n"\
register expenses:groceries

2012/08/11,Kroger,$1,012.80

Ideally, I would like large values to not have the comma separators.
I have spent some time studying "value expressions" in the "info
ledger" pages, and cannot see how to do this.

If it is not possible to get the comma out of the value, I would like
to delimit the fields with something other than a comma. But I could
not find a way to do this either.

Lisa's unattended mail

unread,
Aug 11, 2012, 5:57:30 AM8/11/12
to ledge...@googlegroups.com
On 2012-08-11, Lisa wrote:
>
> If it is not possible to get the comma out of the value, I would like
> to delimit the fields with something other than a comma. But I could
> not find a way to do this either.

I just realized delimiters are in the format string "%D,%P,%t\n". So
I'm now using a format string of "%D!!%P!!%t\n", and then using sed
's/,//g;s/!!/,/'.

John Wiegley

unread,
Aug 11, 2012, 3:28:17 PM8/11/12
to ledge...@googlegroups.com
Alternatively you could use the csv report (in 3.x):

$ ledger --file accounts.gnucash csv expenses:groceries

It will quote fields which use a comma.

John
Reply all
Reply to author
Forward
0 new messages