FR: Include w/ prefixes

5 views
Skip to first unread message

Russell Adams

unread,
Feb 15, 2010, 11:57:00 PM2/15/10
to ledge...@googlegroups.com
Quick feature request, on IRC we had discussed allowing !include to
allow wildcards (rock!).

It would be great if !include would take an optional second parameter
which would be a text prefix applied to each account name in the
included files.

This allows for sub-ledgers....


------------------------------------------------------------------
Russell Adams RLA...@AdamsInfoServ.com

PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/

Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3

Zack Williams

unread,
Feb 16, 2010, 12:21:16 AM2/16/10
to ledge...@googlegroups.com
On Mon, Feb 15, 2010 at 9:57 PM, Russell Adams
<RLA...@adamsinfoserv.com> wrote:
> Quick feature request, on IRC we had discussed allowing !include to
> allow wildcards (rock!).

+1.

Right now, I have a directory structure with one programmatically
generated ledger file per customer, and to look at all of them at once
I cat them all together. Having wildcard support with !include would
remove that step.

- Zack

John Wiegley

unread,
Feb 16, 2010, 11:35:52 PM2/16/10
to ledge...@googlegroups.com
On Feb 15, 2010, at 11:57 PM, Russell Adams wrote:

> Quick feature request, on IRC we had discussed allowing !include to
> allow wildcards (rock!).

Entered as feature request F5B86CC8.

> It would be great if !include would take an optional second parameter
> which would be a text prefix applied to each account name in the
> included files.

This has been a supported feature since the 1.x days:

!account Foo
!include foo.dat
!end

Causes all accounts seen in foo.dat to be located "Foo:...".

John

Alexis

unread,
Feb 19, 2010, 3:52:41 AM2/19/10
to ledge...@googlegroups.com
Hi John,
you write that

> This has been a supported feature since the 1.x days:
>
> !account Foo
> !include foo.dat
> !end
>
> Causes all accounts seen in foo.dat to be located "Foo:...".

I must be doing something wrong because running the following
command using the latest ledger master 5471370 results in an error:
% ledger -f projects.dat reg
While parsing file "projects.dat", line 3:
Error: basic_string::_S_construct NULL not valid
While parsing file "projects.dat", line 7:
Error: basic_string::_S_construct NULL not valid


The files I use are as follows:

=== BEGIN projects.dat ===
!account A
!include a.dat
!end

!account B
!include b.dat
!end
=== END projects.dat ===


=== BEGIN a.dat ===
1994/01/02 * Salary
Asssets:Bank:Checking 200.00
Income:Salary -200.00
=== END a.dat ===


=== BEGIN b.dat ===
1994/01/02 * Rent
Expenses:Rent 100.00
Asssets:Bank:Checking -100.00
=== END b.dat ===

What am I missing?


Alexis

John Wiegley

unread,
Feb 19, 2010, 4:32:39 AM2/19/10
to ledge...@googlegroups.com
On Feb 19, 2010, at 3:52 AM, Alexis wrote:

> I must be doing something wrong because running the following
> command using the latest ledger master 5471370 results in an error:
> % ledger -f projects.dat reg
> While parsing file "projects.dat", line 3:
> Error: basic_string::_S_construct NULL not valid

My friend, you have either found a bug, or your Boost was built with debugging enable, and your Ledger wasn't (or vica-versa). That is the most common cause of that particular assertion.

John

Reply all
Reply to author
Forward
0 new messages