1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460
{\fonttbl\f0\fmodern\fcharset0 Courier;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl264\slmult1\ql\qnatural\pardirnatural
\f0\fs28 \cf0 After a while, your ledger can get to be pretty large. While this\
will not slow down the ledger program much---it's designed to process\
ledger files very quickly---things can start to feel ``messy''; and\
it's a universal complaint that when finances feel messy, people avoid\
them.\
\
Thus, archiving the data from previous years into their own files can\
offer a sense of completion, and freedom from the past. But how to\
best accomplish this with the ledger program? There are two commands\
that make it very simple: @command\{print\}, and @command\{equity\}.\
\
Let's take an example file, with data ranging from year 2000 until\
2004. We want to archive years 2000 and 2001 to their own file,\
leaving just 2003 and 2004 in the current file. So, use\
@command\{print\} to output all the earlier transactions to a file called\
@file\{ledger-old.dat\}:\
\
@smallexample\
ledger -f ledger.dat -b 2000 -e 2001 print > ledger-old.dat\
@end smallexample\
\
To delete older data from the current ledger file, use @command\{print\}\
again, this time specifying year 2002 as the starting date:\
\
@example\
ledger -f ledger.dat -b 2002 print > x\
mv x ledger.dat\
@end example\
\
However, now the current file contains @emph\{only\} postings from\
2002 onward, which will not yield accurate present-day balances,\
because the net income from previous years is no longer being tallied.\
To compensate for this, we must append an equity report for the old\
ledger at the beginning of the new one:\
\
@example\
ledger -f ledger-old.dat equity > equity.dat\
cat equity.dat ledger.dat > x\
mv x ledger.dat\
rm equity.dat\
@end example\
\
Now the balances reported from @file\{ledger.dat\} are identical to what\
they were before the data was split.\
\
How often should you split your ledger? You never need to, if you\
don't want to. Even eighty years of data will not slow down ledger\
much---and that's just using present day hardware! Or, you can keep\
the previous and current year in one file, and each year before that\
in its own file. It's really up to you, and how you want to organize\
your finances. For those who also keep an accurate paper trail, it\
might be useful to archive the older years to their own files, then\
burn those files to a CD to keep with the paper records---along with\
any electronic statements received during the year. In the arena of\
organization, just keep in mind this maxim: Do whatever keeps you\
doing it.}
|