I'm working on a simple program to match credit card payments from the bank to 
my expense accounts.  Gnucash' bayesian filter never seems to work for me ;-)  
And, I'd like to clean up some of the text garbage in the record the bank 

I'm working on a simple matching routine with a hash.  I think I've screwed up the hash somehow.  The second line will match, but 
never the first one.  So (determine-acct "Bank Charge 123") yields NIL, but (determine-acct "City Market 
123") yields the intended "Expenses:Groceries".  If I reverse the lines in the hash and put the "Bank 
Charge" line last, the match on that works and the match on "City Market" fails.  Why?

Any insight appreciated.

# Set account based on description:  "City Market" -> "Expenses:Groceries"
(de account-list
        ("Bank Charge"."Expenses:Bank Fee")         # matches if in last 
        ("City Market"."Expenses:Groceries")        # ONLY this line works to 
(de determine-acct (desc)
        (for x account-list                     # go through account list
                (when (sub? (car x) desc)
                        (cdr x))))                              # on match 
return expense category
Joe Golden --

Reply via email to