2

How can I delete multiple transactions in a batch in GnuCash?

My specific use-case is that I am treating each year as a standalone gnucash file. I start with a copy of the previous year and import the current year transactions into it in order to benefit from trained Bayesian automatic transaction mapping during import. After importing the current year data, I then wish to delete the previous year's data.

4

As a workaround I made a shortcut key for deleting transactions. I modified the C:\Users\username\.gnu-cash\accelerator-map file (with gnucash closed) by changing the line

; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/DeleteTransactionAction" "")

To:

(gtk_accel_path "<Actions>/GncPluginPageRegisterActions/DeleteTransactionAction"
"<Primary>Delete")

Now I could delete transactions by pressing ctrl+delete. Pressing and holding this key combination allowed continuous deleting at a predictable rate so it was quite easy to delete a few hundred transactions quickly.

Might not be the best solution if you have many thousands of transactions that you want to delete but for a few hundred it was quite painless.

  • Works great. However, in Ubuntu 19.04, my accelerator-map file was located in /home/username/.local/share/gnucash/accelerator-map – Lukas Bradley Jun 1 at 16:35
1

As a follow-up to this very useful info, on a Windows PC, the file is located in:

C:\Users\UserName\AppData\Roaming\GnuCash\accelerator-map

The way the edited line is displayed in the above answer is correct but it may not be immediately obvious to everyone that like some other languages, the semicolon needs to be removed as well. The semicolon is a comment tag that disables the line it is on.

Notes:

<Primary> is the same as "Command" on macs and "Ctrl" on Windows. Other modifiers are <Shift> and <Alt> and they can be combined so to make it a bit more difficult to do accidentally, my new line is:

(gtk_accel_path "<Actions>/GncPluginPageRegisterActions/DeleteTransactionAction" "<Primary><Shift>Delete")

AKA: Control + Shift + Delete

I presume it was the same in earlier versions but I am new to GNUcash so it's also useful to note that, at least as of GNUcash 3.5, this keyboard shortcut triggers the Yes/No dialog to confirm that the transaction should be deleted. Additionally, you can select to ignore the dialog for the rest of the session or never show the dialog.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.