Re: Re-naming accounts..

2016-01-05 Thread Douglas Philips
On 1/4/16 11:47 PM, John Wiegley wrote:
>> Douglas Philips  writes:
> 
>> I read through the manual (2.6.3, but the v3 manual is the same)... There is
>> an example of using virtual accounts and automatic transactions to move
>> money into a tithing liability account. Then real transactions are used to
>> pay out of that virtual account? (section 5.22.9 in the v3 documentation
>> pdf) That's where I get confused. If a report is run with --real then won't
>> the balances be wrogn?
> 
> --real would just show a positive balance for that liability account, since
> the goal without --real is to bring it to zero. No bug deal, the --real report
> just looks like I've been spending money to a Liability for no reason.

Ah, OK... (Still wrapping my head around that)


>> Then I want to say that there is just one actual payment from the checking
>> to the liability that "absorbs" the budget account amount (or some part of
>> it), all at once.
> 
> I'd have to see an example of this to completely clear on what you mean...

Ok, so let's say that I have a bunch of "small" transactions.
Meals, petrol purchases, etc.
All these move assests (USD) from my Liabilities:Credit Card:CardX account
to various expense accounts.  So I can see what I owe to the CardX company based
on that. And for small expenses I can directly subtract that from my checking 
account balance
to see what I'd have left after paying them off.

But.

For larger expenses (car repairs, house repairs), I want to pay them off slower,
so let's say for the small expenses I add the full amount to the budget account,
but for larger expenses I might only add, say, $100 to the budget account.
Now the statement comes. I can see from my budget account how much I intend to 
pay,
and thus I know in advance how much of a hit my checking account will take.
Which keeps me from spending that money on something else by accident.

Ok, so the statement comes and I cut a check.
This is recorded as a transaction between my checking account and my 
Liabilities:Credit Card:CardX
account. This will also be a transaction that shows up on both accounts and can 
be reconciled.
The budget account transactions have nothing against which they can be 
reconciled.
However, since I have made a payment to the Liabilities account, I also want to 
deduct
that from the Budget account so that I know I have relieved some of that 
obligation and can have
an accurate view of the amount I still holding in reserve.

So maybe a better name would be Reserve:CardX and not Budget:CardX. I'm not 
sure if that
makes any difference, but at least I'm clearer on what my intentions are.

To put it another way, the budget (or reserve) transaction is a check that I 
write mentally
to "prepay" the credit card obligation, but it's not a real transaction that 
can be reconciled
so I can't actually record it as a transaction against checking without really 
getting confused
when the checking account statement arrives.

-=Doug (needs more coffee this early)

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re-naming accounts..

2016-01-04 Thread Douglas Philips
On 1/4/16 2:15 PM, John Wiegley wrote:
>> Martin Blais  writes:
> 
>> Stay away from virtual postings, they break the accounting equation. You
>> never need to use them, period.
> 
> I disagree with this statement. I've used them to good effect in the past.
> There are times when you need a bit of flexibility to get exactly the kind of
> reports you want. It's not all about accounting, or honoring the accounting
> equation; it's about managing finances the way a Ledger user wants to. I think
> this pretty much sums up the core philosophical divide between beancount and
> Ledger.

So this is interesting timing, I was thinking of using virtual postings to 
track budget amounts.
Specifically, when I have a credit card expense, I have a posting such as:

2016/01/01 Fix the thing
Expenses:Thing $20.00
Liabilities:Credit Card:Pursuit   $-20.00


What I have been doing as an experiment is to add in something additional:

2016/01/01 Fix the thing
Expenses:Thing $20.00
Liabilities:Credit Card:Pursuit   $-20.00
Budget:Pursuit $20.00
Assests:Checking  $-20.00

So that way I can see what my checking balance will be when I pay the bill for 
the Pursuit card.
This way I can see the balance of the checking account afterwards. I can't see 
it before, which is annoying.
And, when I pay off the bill (directly from Checking), I have to go back and 
delete all those additional lines.
Ugh.
So, I was thinking why not use virtual postings?

Or is there a better way?

Thanks to John for such a cool tool, and Martin for having an alternative.

-=Doug

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re-naming accounts..

2016-01-04 Thread John Wiegley
> Martin Blais  writes:

> Stay away from virtual postings, they break the accounting equation. You
> never need to use them, period.

I disagree with this statement. I've used them to good effect in the past.
There are times when you need a bit of flexibility to get exactly the kind of
reports you want. It's not all about accounting, or honoring the accounting
equation; it's about managing finances the way a Ledger user wants to. I think
this pretty much sums up the core philosophical divide between beancount and
Ledger.

-- 
John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re-naming accounts..

2016-01-04 Thread Ben Finney
Mark Scannell  writes:

> The challenge is that I have my partner's books, my books, and then
> our joint books. As our finances are gradually being treated as one,
> I'd like to be able to have Assets -> mine, Assets -> hers, Assets ->
> ours, Expenses -> mine|hers|ours, etc.

Pete Keen described a way to use Ledger's “virtual transactions” and
“automated transactions” to maintain a split such as you describe, while
allowing the split to be conflated when needing to deal with the “real”
transactions.

Some people decide to do this by dividing the bills up between
roommates. […] Other roommates decide to nominate one person to have
all of the bills in their name and post the amounts due every month
for everyone to see. This is what my girlfriend and have been doing
and it's been working great. All of the bills are in my name and I
give her a summary every month and she hands me a check. Easy peasy.

[…] Ledger has an extremely handy feature named automated
transactions. The basic idea is that you provide a template
transaction and a pattern to match, and ledger will insert the
filled-in template transaction every time the pattern matches.

[…] For various reasons I keep most of my money in [one real
account]. I have most of it allocated away into various "funds",
which are just fake buckets that only exist for me. […] I've
implemented these buckets using ledger's virtual transaction
feature.

[…] On their own, these two features are pretty useful. It's when
you combine them that the awesome power of ledger starts appearing.



-- 
 \   “In the long run nothing can withstand reason and experience, |
  `\and the contradiction which religion offers to both is all too |
_o__)palpable.” —Sigmund Freud |
Ben Finney

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re-naming accounts..

2016-01-04 Thread John Wiegley
> Douglas Philips  writes:

> What I have been doing as an experiment is to add in something additional:

> 2016/01/01 Fix the thing
> Expenses:Thing $20.00
> Liabilities:Credit Card:Pursuit   $-20.00
> (Budget:Pursuit)   $20.00

Now you can just do a balance query of Assets:Checking against Budget and see
what the net result will be.  Or use --real to strip away the budget, or just
don't query against Budget.

> Thanks to John for such a cool tool, and Martin for having an alternative.

You're most welcome!

-- 
John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re-naming accounts..

2016-01-04 Thread Jeffrey Brent McBeth
On Mon, Jan 04, 2016 at 02:04:38PM -0800, John Wiegley wrote:
> > Douglas Philips  writes:
> 
> > What I have been doing as an experiment is to add in something additional:
> 
> > 2016/01/01 Fix the thing
> > Expenses:Thing $20.00
> > Liabilities:Credit Card:Pursuit   $-20.00
> > (Budget:Pursuit)   $20.00
> 
> Now you can just do a balance query of Assets:Checking against Budget and see
> what the net result will be.  Or use --real to strip away the budget, or just
> don't query against Budget.

I'm really happy using the imperative (I forget the term) virtual accounts 
(surrounded by []), it maintains the accounting equation, I can easily query 
how much is really in my checking vs how much is unallocated to ther budget 
things, and I can square things up periodically if I choose.

Jeff

-- 
"The man who does not read good books has no advantage over 
 the man who cannot read them."
 -- Mark Twain

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re-naming accounts..

2016-01-04 Thread John Wiegley
> Douglas Philips  writes:

> I read through the manual (2.6.3, but the v3 manual is the same)... There is
> an example of using virtual accounts and automatic transactions to move
> money into a tithing liability account. Then real transactions are used to
> pay out of that virtual account? (section 5.22.9 in the v3 documentation
> pdf) That's where I get confused. If a report is run with --real then won't
> the balances be wrogn?

--real would just show a positive balance for that liability account, since
the goal without --real is to bring it to zero. No bug deal, the --real report
just looks like I've been spending money to a Liability for no reason.

> Then I want to say that there is just one actual payment from the checking
> to the liability that "absorbs" the budget account amount (or some part of
> it), all at once.

I'd have to see an example of this to completely clear on what you mean...

-- 
John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re-naming accounts..

2016-01-04 Thread Douglas Philips
On 1/4/16 6:27 PM, Jeffrey Brent McBeth wrote:
> On Mon, Jan 04, 2016 at 02:04:38PM -0800, John Wiegley wrote:
>>> Douglas Philips  writes:
>>
>>> What I have been doing as an experiment is to add in something additional:
>>
>>> 2016/01/01 Fix the thing
>>>  Expenses:Thing $20.00
>>>  Liabilities:Credit Card:Pursuit   $-20.00
>>>  (Budget:Pursuit)   $20.00
>>
>> Now you can just do a balance query of Assets:Checking against Budget and see
>> what the net result will be.  Or use --real to strip away the budget, or just
>> don't query against Budget.
> 
> I'm really happy using the imperative (I forget the term) virtual
> accounts (surrounded by []), it maintains the accounting equation, I
> can easily query how much is really in my checking vs how much is
> unallocated to ther budget things, and I can square things up
> periodically if I choose.

Ok, here's where I get confused about Virtual accts, parenthetical or 
squared-off)

I read through the manual (2.6.3, but the v3 manual is the same)...
There is an example of using virtual accounts and automatic transactions to 
move money into
a tithing liability account. Then real transactions are used to pay out of that 
virtual account?
(section 5.22.9 in the v3 documentation pdf)
That's where I get confused. If a report is run with --real then won't the 
balances be wrogn?


I want to move funds from checking to some kind of budget-y account, yet be 
able to see the
actual checking amounts and the "diminished by budget-y" amounts.
Ok, I think I can do that with virtual transactions as John showed above.

Then I want to say that there is just one actual payment from the checking to 
the liability that
"absorbs" the budget account amount (or some part of it), all at once. This is 
the one transaction
that the bank will see and that will be on the statement for reconciling 
purposes.
So how do I get the budget amount not to interfere with the payment amount when 
running register reports
with and without --real. (that is, I don't want to have to avoid --real or have 
to use it...)

Hmmm, hope that is slightly clearer than mud!

Thanks,
-=Doug


-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re-naming accounts..

2016-01-04 Thread Martin Blais
Stay away from virtual postings, they break the accounting equation. You
never need to use them, period. They are a crutch that misleads many into
not figuring things out. Beancount doesn't even support them and I've doing
everything without so far without problems (though it has forced me to
learn bookkeeping).

I see at least two ways of accounting for shared expenses:


1. The simple way: You can simply create a Liabilities account. When you
book a shared expense, you book a portion of it to the liabilities account,
e.g.

2015-12-11 * "CON EDISON   ONLINE PMT"
  Assets:US:Checking  -46.51 USD
  Liabilities:AccountsPayable:Caroline  46.51/2
USD
  Expenses:Home:Electricity

You can then share the account on that liabilities account with your
partner. Cut-n-pasting from the web interface into gmail preserves the HTML
so that's one easy way share the balance details. However much your
roommate/partner owes is the balance of that account.

It's really convenient because you can use that account for a variety of
purposes. It effectively separates the "counting" and the "payment".
Counting occurs off the liabilities account; payments occur off the
balance, paid to the account.



2. You can create a separate book. I used to do this for joint expenses and
assets. I describe this here in much detail in the context of a trip but
you can do the same thing, continuously:

http://furius.ca/beancount/doc/sharing

This uses a plugin to split up shared expenses easily, but you can do it
manually too.


As for using virtual units to track only a portion of amounts where you
feel you need "virtual" units or "virtual postings", the technique you can
use that doesn't break the accounting equation is to use a mirror currency
instead. I've described this a number of times on this list. There's even a
plugin to automate that method in Beancount. Look for mirror accounting in
the archives.




http://furius.ca/beancount/doc/sharing

On Mon, Jan 4, 2016 at 7:02 AM, Ben Finney <
bignose+hates-s...@benfinney.id.au> wrote:

> Mark Scannell  writes:
>
> > The challenge is that I have my partner's books, my books, and then
> > our joint books. As our finances are gradually being treated as one,
> > I'd like to be able to have Assets -> mine, Assets -> hers, Assets ->
> > ours, Expenses -> mine|hers|ours, etc.
>
> Pete Keen described a way to use Ledger's “virtual transactions” and
> “automated transactions” to maintain a split such as you describe, while
> allowing the split to be conflated when needing to deal with the “real”
> transactions.
>
> Some people decide to do this by dividing the bills up between
> roommates. […] Other roommates decide to nominate one person to have
> all of the bills in their name and post the amounts due every month
> for everyone to see. This is what my girlfriend and have been doing
> and it's been working great. All of the bills are in my name and I
> give her a summary every month and she hands me a check. Easy peasy.
>
> […] Ledger has an extremely handy feature named automated
> transactions. The basic idea is that you provide a template
> transaction and a pattern to match, and ledger will insert the
> filled-in template transaction every time the pattern matches.
>
> […] For various reasons I keep most of my money in [one real
> account]. I have most of it allocated away into various "funds",
> which are just fake buckets that only exist for me. […] I've
> implemented these buckets using ledger's virtual transaction
> feature.
>
> […] On their own, these two features are pretty useful. It's when
> you combine them that the awesome power of ledger starts appearing.
>
>  https://www.petekeen.net/program-your-finances-automated-transactions>
>
> --
>  \   “In the long run nothing can withstand reason and experience, |
>   `\and the contradiction which religion offers to both is all too |
> _o__)palpable.” —Sigmund Freud |
> Ben Finney
>
> --
>
> ---
> 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 ledger-cli+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re-naming accounts..

2016-01-03 Thread Stefano Zacchiroli
On Sun, Jan 03, 2016 at 05:40:57AM -0800, Mark Scannell wrote:
> As our finances are gradually being treated as one, I'd like to be
> able to have Assets -> mine, Assets -> hers, Assets -> ours, Expenses
> -> mine|hers|ours, etc.

FWIW I'm in a similar situation, but I've decided to only separate by
owners the Assets hierarchy, and only where's relevant (e.g., bank
accounts that formally belong to a single person). But I haven't
separated the Expenses hierarchy, because I considered that would be
overkill. Instead, I'm using an "Author: " tag to separate transactions
by person. I'm fairly happy with the result, but I'll gladly hear about
different experiences.

> A simple regex substitution works fine, so the ledger print | sed -e '//' | 
> ledger -f - type of solution can work.

We've discussed this in the past IIRC, and the general feeling was that
it'd be nice to have a grammar-aware tool to rename accounts
consistently. But also that there is no such tool right now, and
therefore people are using various sed-based workarounds. My own scripts
to that end are attached. (They're provably incomplete/incorrect in
various corner cases, but they work well enough for me, and try hard to
preserve the right amount of horizontal spacing, which was a must for
me.)

Cheers.
-- 
Stefano Zacchiroli  . . . . . . .  z...@upsilon.cc . . . . o . . . o . o
Maître de conférences . . . . . http://upsilon.cc/zack . . . o . . . o o
Former Debian Project Leader . . . . . @zacchiro . . . . o o o . . . o .
« the first rule of tautology club is the first rule of tautology club »

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#!/usr/bin/perl -w

# Copyright (C) 2014 Stefano Zacchiroli 
# License: GNU General Public License (GPL), version 3 or above

# parse current "git diff" and determine ledger account renames

use strict;
use Carp::Assert;

open(GIT, "git diff |");
my @del_accts = ();
my @add_accts = ();
while (my $line = ) {
if ($line =~ /^-account\s+(.*)$/) {
push @del_accts, $1;
} elsif ($line =~ /^\+account\s+(.*)$/) {
push @add_accts, $1;
} elsif (@del_accts) {
assert($#del_accts == $#add_accts,
   "even number of added/removed accounts");
for (my $i = 0 ; $i <= $#del_accts ; $i++) {
print $del_accts[$i], "\t->\t", $add_accts[$i], "\n";
}
@del_accts = ();
@add_accts = ();
}
}
close(GIT);
#!/usr/bin/perl

# Copyright (C) 2014 Stefano Zacchiroli 
# License: GNU General Public License (GPL), version 3 or above

use strict;

while (my $line = <>) {
$line =~ s/\s+$//;
print $line, "\n";
}
#!/bin/bash

# Copyright (C) 2014 Stefano Zacchiroli 
# License: GNU General Public License (GPL), version 3 or above

sed_flags="--follow-symlink --regexp-extended"

if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then
echo "Usage: $0 OLD_ACCT_NAME NEW_ACCT_NAME LEDGER_FILE..."
exit 1
fi
old_name="$1"
new_name="$2"
shift 2

old_len=${#old_name}
new_len=${#new_name}
if [ $old_len -lt $new_len ] ; then
sed $sed_flags -i "s/^( *)$(printf "%-${new_len}s" 
"$old_name")/\\1${new_name}/" "$@"
sed $sed_flags -i "s/^( *)${old_name} *$/\\1${new_name}/" "$@"
elif [ $old_len -gt $new_len ] ; then
new_name=$(printf "%-${old_len}s" "$new_name")
sed $sed_flags -i "s/^( *)${old_name}(  |$)/\\1${new_name}\\2/" "$@"
fi

for f in "$@" ; do
bin/normalize-spaces "$f" | sponge "$f"
done
#!/bin/bash

LEDGERS=$(bin/ls-ledgers)
MAPPING=".icsv2ledgerrc-mapping"

bin/diff-accounts | \
while IFS=$'\t' read old_acct _sep new_acct ; do
for l in $LEDGERS ; do
bin/rename-account "$old_acct" "$new_acct" "$l"
done
sed -ri "s/,${old_acct}(,|$)?/,${new_acct}\\1/" "$MAPPING"
done


Re: Re-naming accounts..

2016-01-03 Thread Mark Scannell
Martin,

I do need to check out more beancount one day.

I'm now trying something like this:
ledger -f main.ledger --limit xyz print |  | ledger -f 
- -f prices.ledger --display xyz bal

Then I can just use sed or whatever I'd like.

Mark


On Saturday, 2 January 2016 21:35:59 UTC, Martin Blais wrote:
>
> You could easly write a wrapper script that applies your renames to 
> another file and then runs your report on that.
> Always generate & delete the intermediate file.
>
> Beancount's approach would be different: A plugin would be used to rewrite 
> the account names in the transactions data structures directly.
>
>
>
> On Sat, Jan 2, 2016 at 4:31 PM, Mark Scannell  > wrote:
>
>> Hello all --
>>
>> Is it possible to apply a regular expression to rename accounts?
>>
>> I have a complex structure of three account sets, all with 
>> Ass|Lia|Inc|Exp|Equ, and sub-categories in Assets (Current, Pension, and 
>> Fixed). I'd like to apply a regular expression to re-order the structure of 
>> the accounts for reporting purposes, without changing the underlying data.
>>
>> I know I can do this in the source data, but I'd rather not do that.
>>
>> Thanks!
>>
>> Mark
>>
>> -- 
>>
>> --- 
>> 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 ledger-cli+...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re-naming accounts..

2016-01-03 Thread Mark Scannell
Martin,

I was thinking of that, and I may use alias' as I have a lot of 
abbreviations. The challenge is that I have my partner's books, my books, 
and then our joint books. As our finances are gradually being treated as 
one, I'd like to be able to have Assets -> mine, Assets -> hers, Assets -> 
ours, Expenses -> mine|hers|ours, etc.

A simple regex substitution works fine, so the ledger print | sed -e '//' | 
ledger -f - type of solution can work.

Mark


On Sunday, 3 January 2016 00:14:07 UTC, Martin Michlmayr wrote:
>
> * Mark Scannell  [2016-01-02 13:31]: 
> > I have a complex structure of three account sets, all with 
> > Ass|Lia|Inc|Exp|Equ, and sub-categories in Assets (Current, Pension, and 
> > Fixed). I'd like to apply a regular expression to re-order the structure 
> of 
> > the accounts for reporting purposes, without changing the underlying 
> data. 
> > 
> > I know I can do this in the source data, but I'd rather not do that. 
>
> I'm not sure what you mean by re-order the structure, but if you want 
> to change the account names, you can create an account alias. 
>
> account Assets:newname 
> alias Assets:oldname 
>
> 2015-01-02 * Test 
> Assets:oldname 10.00 EUR 
> Equity 
>
> $ ledger -f d reg assets 
> 2015-01-02 Test  Assets:newname  10.00 EUR 10.00 
> EUR 
>
> -- 
> Martin Michlmayr 
> http://www.cyrius.com/ 
>

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re-naming accounts..

2016-01-02 Thread Martin Michlmayr
* Mark Scannell  [2016-01-02 13:31]:
> I have a complex structure of three account sets, all with 
> Ass|Lia|Inc|Exp|Equ, and sub-categories in Assets (Current, Pension, and 
> Fixed). I'd like to apply a regular expression to re-order the structure of 
> the accounts for reporting purposes, without changing the underlying data.
> 
> I know I can do this in the source data, but I'd rather not do that.

I'm not sure what you mean by re-order the structure, but if you want
to change the account names, you can create an account alias.

account Assets:newname
alias Assets:oldname

2015-01-02 * Test
Assets:oldname 10.00 EUR
Equity

$ ledger -f d reg assets
2015-01-02 Test  Assets:newname  10.00 EUR 10.00 EUR

-- 
Martin Michlmayr
http://www.cyrius.com/

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re-naming accounts..

2016-01-02 Thread Martin Blais
You could easly write a wrapper script that applies your renames to another
file and then runs your report on that.
Always generate & delete the intermediate file.

Beancount's approach would be different: A plugin would be used to rewrite
the account names in the transactions data structures directly.



On Sat, Jan 2, 2016 at 4:31 PM, Mark Scannell  wrote:

> Hello all --
>
> Is it possible to apply a regular expression to rename accounts?
>
> I have a complex structure of three account sets, all with
> Ass|Lia|Inc|Exp|Equ, and sub-categories in Assets (Current, Pension, and
> Fixed). I'd like to apply a regular expression to re-order the structure of
> the accounts for reporting purposes, without changing the underlying data.
>
> I know I can do this in the source data, but I'd rather not do that.
>
> Thanks!
>
> Mark
>
> --
>
> ---
> 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 ledger-cli+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.