Skip finding duplicate transactions on QIF import

Derek Atkins warlord at MIT.EDU
Wed Feb 14 10:25:35 EST 2007


Um, I highly recommend you NOT make this change.  It completely
bypasses duplicate checking in all cases, which is far from correct.

A better fix would be a change to the query/algorithm to make
it faster.

-derek

Jeff Carneal <jeff-ml at soldmy.net> writes:

> 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 :)
> _______________________________________________
> 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.
>
>

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-user mailing list