Close book + new file

Doug Pastorello SpiderDad10 at comcast.net
Wed Jan 7 22:06:46 EST 2009


For those who expressed interest in this, I've attached my perl script.
It is not the cleanest way to clear out old transactions, but should be
O.K. until one of us gets around to doing the real thing in GnuCash.

Here is how I use it;
o Create an account summary report up to the end of <year>
  - This will be used to create the initial account balances in the
    new file, so export it so you can use it later.
o gunzip the GC file (may need to add a ".gz" to the name)
o run gcCull.pl <file> <year>
  - This removes all transactions older than last day of <year>
    (except for stock and mutual fund accounts)
  - new_<file> is created
o Open the new file in GC
o Run Actions/Check&repair/Check&Repair all
o Delete any unused accounts, sub-account, and transactions
o zero out the "imbalance" accounts using transfers from
  "Retained Earnings". (optional)
o Create starting balances for cleaned accounts using the account
  summary created from the original database.

There are 2 subroutines that determine when splits should be removed, so
the script should be easy to customize to your needs.

Let me know how things work out :)
	-- Doug.

On Tue, 2009-01-06 at 22:09 -0600, Mark Steph wrote:
> Hey,
> This sounds exactly like what I am looking for (and was about to write
> myself.)
> 
> Could I get a copy of it?
> 
> Doug Pastorello wrote:
> > Roberto,
> > I have a perl script that may help. It goes through the GnuCash database
> > and deletes old splits and transactions. It leaves all the "STOCK" and
> > "MUTUAL" splits alone. The new database needs to be cleaned-up a bit by
> > using "Check&Repair", and adding starting balances to the accounts. I
> > used it to clean-up my 10 year old database, and now loading and saving
> > are MUCH faster. If folks are interested, I can post the script.
> > 	-- Doug.
> > 
> > On Sun, 2009-01-04 at 21:40 +0100, Roberto Hernandez wrote:
> >> Hello all,
> >>
> >> I'm in the process of closing the books for 2008. As far as I know,
> >> the Tools -> Close Book only creates transactions that zero the Income
> >> and Expense accounts. This approach is fine, but the system becomes
> >> slower because all transactions from the previous year remain in the
> >> data file.
> >>
> >> Therefore, in order to avoid the performance hit, I believe the only
> >> solution is to start a new data file for 2009. It's either that or
> >> changing to a database backend instead of XML ;-) (any plans for
> >> that?)
> >>
> >> I was just wondering whether there is any tool that automates the
> >> process of creating the starting balance transactions as described in
> >> http://wiki.gnucash.org/wiki/FAQ#Q:_Is_there_book-closing_support.2C_yet.3F
> >>
> >> TIA
> >>
> >> Roberto
> >> _______________________________________________
> >> gnucash-user mailing list
> >> gnucash-user at gnucash.org
> >> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> >> -----
> >> Please remember to CC this list on all your replies.
> >> You can do this by using Reply-To-List or Reply-All.
> > 
> > _______________________________________________
> > gnucash-user mailing list
> > gnucash-user at gnucash.org
> > https://lists.gnucash.org/mailman/listinfo/gnucash-user
> > -----
> > Please remember to CC this list on all your replies.
> > You can do this by using Reply-To-List or Reply-All.
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcCull.pl
Type: application/x-perl
Size: 8699 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-user/attachments/20090107/6db96e14/attachment.bin 


More information about the gnucash-user mailing list