$archiver
NSKeyedArchiver
$objects
$null
$class
CF$UID
37
NS.objects
CF$UID
2
$class
CF$UID
33
NS.keys
CF$UID
3
CF$UID
4
CF$UID
5
NS.objects
CF$UID
6
CF$UID
7
CF$UID
35
Title
Text
Date
Untitled Snapshot
$class
CF$UID
34
NSAttributes
CF$UID
10
NSDelegate
CF$UID
0
NSString
CF$UID
8
$class
CF$UID
9
NS.string
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.
$classes
NSMutableString
NSString
NSObject
$classname
NSMutableString
$class
CF$UID
33
NS.keys
CF$UID
11
CF$UID
12
NS.objects
CF$UID
13
CF$UID
30
NSParagraphStyle
NSFont
$class
CF$UID
29
NSAlignment
4
NSLineHeightMultiple
1.1000000238418579
NSTabStops
CF$UID
14
$class
CF$UID
28
NS.objects
CF$UID
15
CF$UID
17
CF$UID
18
CF$UID
19
CF$UID
20
CF$UID
21
CF$UID
22
CF$UID
23
CF$UID
24
CF$UID
25
CF$UID
26
CF$UID
27
$class
CF$UID
16
NSLocation
28
$classes
NSTextTab
NSObject
$classname
NSTextTab
$class
CF$UID
16
NSLocation
56
$class
CF$UID
16
NSLocation
84
$class
CF$UID
16
NSLocation
112
$class
CF$UID
16
NSLocation
140
$class
CF$UID
16
NSLocation
168
$class
CF$UID
16
NSLocation
196
$class
CF$UID
16
NSLocation
224
$class
CF$UID
16
NSLocation
252
$class
CF$UID
16
NSLocation
280
$class
CF$UID
16
NSLocation
308
$class
CF$UID
16
NSLocation
336
$classes
NSArray
NSObject
$classname
NSArray
$classes
NSParagraphStyle
NSObject
$classname
NSParagraphStyle
$class
CF$UID
32
NSName
CF$UID
31
NSSize
14
NSfFlags
16
Courier
$classes
NSFont
NSObject
$classname
NSFont
$classes
NSDictionary
NSObject
$classname
NSDictionary
$classes
KBWordCountingTextStorage
NSTextStorage
NSMutableAttributedString
NSAttributedString
NSObject
$classname
KBWordCountingTextStorage
$class
CF$UID
36
NS.time
267380389.34101999
$classes
NSDate
NSObject
$classname
NSDate
$classes
NSMutableArray
NSArray
NSObject
$classname
NSMutableArray
$top
Snapshots
CF$UID
1
$version
100000