Deleting large numbers of trx

Sébastien de Menten sdementen at gmail.com
Mon Mar 9 16:06:08 EDT 2015


Hi,

For this kind of manipulations, and if your are on linux (ie with python
available), you could use piecash (http://piecash.readthedocs.org/en/latest/
).

Your python script would look like :
##### START ################
import piecash

book = piecash.open_book("your_book_that_will_be_modified.gnucash",
readonly=False)
for tr in book.transactions:
    if tr.post_date.strftime("%Y/%m/%d") >= "2012/01/01":
        book.delete(tr)
book.save()
##### END ################

*WARNING : *always do a backup of your file before manipulating it with
piecash

kr

sebastien

On Sun, Mar 8, 2015 at 8:37 PM, YeOldHinnerk <HRamthun at gmx.de> wrote:

> Hi,
>
> well, exporting just the CoA won't help him learn the way I use the
> accounts. I want so meaningfull trx in there.
> Using an old GnuCash file from 2 years ago won't be good, since I have
> changed my CoA since then quite a lot and the current version is what he
> should get.
>
> I know that such an operation is very un-accountingly so to say - why would
> you ever want to bulk delete transaction? But maybe someone has created a
> script to do so. If not, I may do so myself and post it on wiki.
>
> Best,
>
> YeOldHinnerk
>
>
>
> --
> View this message in context:
> http://gnucash.1415818.n4.nabble.com/Deleting-large-numbers-of-trx-tp4676690p4676726.html
> Sent from the GnuCash - User mailing list archive at Nabble.com.
> _______________________________________________
> 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.
>


More information about the gnucash-user mailing list