Skip finding duplicate transactions on QIF import
Jeff Carneal
jeff-ml at soldmy.net
Tue Feb 13 13:01:56 EST 2007
Ok, so I doubt anyone cares but me, but you never know...
I have several largish hand-crafted qif files that I will be
importing on a monthly basis and while doing that for the first time
today I noticed that the finding duplicate transaction import code
was taking forever on my spiffy new intel mac. To the tune of 5-10
minutes, that is.
Since I know there are no (or very few duplicates), I wanted to
simply disable the duplicate transaction checking code. I finally
found it in qif-merge-groups.scm and made a very trivial change to
the gnc:group-find-duplicates function. Please note this is a much
of a hack as it could possibly be, and I'm aware of that. But it's
going to save me time and I figured there was a chance someone else
wanted this change as well.
I suppose if enough people were interested I'd code in a preference
for "finding duplicates" where you could switch this on and off, but
I doubt that will be the case. Let me know if I'm mistaken.
Without further ado, here's the function. Simply replace all of the
function gnc:group-find-duplicates in your qif-merge-groups.scm with
this and you're good to go.
(define (gnc:group-find-duplicates old-group new-group window)
;; get all the transactions in the new group, then iterate over them
;; trying to find matches in the new group. If there are matches,
;; push the matches onto a list.
(let* ((new-xtns (gnc:group-get-transactions new-group))
(progress-dialog #f)
(work-to-do (length new-xtns))
(work-done 0)
(matches '()))
;; get rid of the progress dialog
(if progress-dialog
(gnc:progress-dialog-destroy progress-dialog))
;; return the matches
matches))
Jeff
PS - No, I don't know scheme so I can't help you with anything else
scheme-related. Hell, this probably isn't right either but it works :)
More information about the gnucash-user
mailing list