Importing QIF files

Derek Atkins warlord at MIT.EDU
Fri Feb 6 11:25:25 EST 2015


Mark,

At this point it would still help if you CC'd gnucash-user on your
replies.  I know why you unsubscribed, but this is getting to the point
where other people should see this (and be able to help), in particular
other developers.

Mark Wigmore <mawigmore at gmail.com> writes:

> Hi,
>
> I finished setting all the 'Exchange or abbreviation types' but then it failed
> again saying a bug has been found. Attached is the log file.
>
> Any ideas?

The tail of the log shows:

 363: 18* (if (not (qif-xtn:mark xtn)) (qif-import:mark-matching-xtns xtn rest))
 364: 19  [qif-import:mark-matching-xtns # #]
 804: 20  [splitloop (#)]
 810: 21* (if (not (null? splits-left)) (if (and # #) (set! splits-left #) ...))
 811: 22  (if (and # #) (set! splits-left #) (set! splits-left #))
 813: 23  (set! splits-left (qif-import:mark-some-splits splits-left xtn ...))
 814: 24* [qif-import:mark-some-splits # # #]
 829: 25  (let* ((n- #) (nsub #) (n+ #) ...) (if bank-xtn? (begin # # ...) ...) 
...)
 902: 26* [xtn-loop (# # # # ...)]
 903: 27* (if (and # #) (begin # #))
 903: 28* (and (not (qif-xtn:mark #)) (string=? (qif-xtn:from-acct #) far-acct-n
ame))
 904: 29  [string=? "SunLife Endowment" #f]
C:\Program Files (x86)\gnucash\share\gnucash/scm/qif-import/qif-to-gnc.scm:904:1
6: In procedure string= in expression (string=? (qif-xtn:from-acct #) far-acct-n
ame):
C:\Program Files (x86)\gnucash\share\gnucash/scm/qif-import/qif-to-gnc.scm:904:1
6: Wrong type argument in position 2 (expecting string): #f

This is a similar issue to what we said before -- there is, most likely,
an empty field.  Either something didn't get mapped properly or there's
a place in your QIF where it defines an empty category/account?  Are
there any empty 'L' or 'S' lines in your QIF?

> Mark

-derek

> On 5 February 2015 at 18:14, Derek Atkins <derek at ihtfp.com> wrote:
>
>     Hi,
>    
>     On Thu, February 5, 2015 12:41 pm, Mark Wigmore wrote:
>     > Progress! I removed all the CX strings from the T lines and it gets
>     > through
>     > the parser!
>    
>     Excellent.
>    
>     > I have a new problem now in that all my non-GBP holding are no longer in
>     > their original currency. I'm also a bit baffled by the attached. What do
>     I
>     > select for a stock on the London exchange?
>    
>     Thats not too surprising.  QIF does not support multiple currencies.
>     That's probably what the underlying issue is; the other app did
>     *something* to create their own way to store a multi-currency transaction,
>     but there is no standard for it.
>    
>     The best way to handle multiple currencies in QIF is to make multiple QIF
>     files, one for each currency.  Alas, that's really the only thing you can
>     do, and you still might have issues importing the cross-currency
>     transactions.
>    
>     The "Exchange or abbreviation type" is just a way for you to collect
>     similar stocks together.  It's a free-form text entry with a set of
>     pre-defined entries.  If none of the existing entries works for you then
>     you can just type in your own.
>    
>     > Mark
>    
>     -derek
>    
>     >
>     > On 5 February 2015 at 17:35, Mark Wigmore <mawigmore at gmail.com> wrote:
>     >
>     >> Here's a screenshot of the last few entries from the first pass of the
>     >> importer.
>     >>
>     >> Nearly everything above that is of the first type, unrecognised
>     >> reconciliation status.
>     >>
>     >> Yes, seems to be specifying the type of account:
>     >>
>     >> !Account
>     >> NBarnsley
>     >> DBarnsley Building Society
>     >> TBank
>     >> ^
>     >>
>     >> Let me know if you need anything else.
>     >>
>     >> Mark
>     >>
>     >> On 5 February 2015 at 17:16, Derek Atkins <warlord at mit.edu> wrote:
>     >>
>     >>> Hi,
>     >>>
>     >>> Mark Wigmore <mawigmore at gmail.com> writes:
>     >>>
>     >>> > On 4 February 2015 at 14:29, Derek Atkins <warlord at mit.edu> wrote:
>     >>> >
>     >>> >     I understand you're unwilling to do that, but honestly, it's not
>     >>> that
>     >>> >     hard to do something like:
>     >>> >
>     >>> >     grep '^N$' file.qif
>     >>> >
>     >>> >
>     >>> > I get 2369 matches! The first in investments is this on line 21301:
>     >>> >
>     >>> > !Type:Invst
>     >>> > D01/01/1970
>     >>> > T3612.25CX
>     >>> > N
>     >>> > POpening Balance
>     >>> > M
>     >>> > L[Start Balance]
>     >>> > ^
>     >>>
>     >>> Aha!!  The "CX" is wrong in the T line, and is probably what's causing
>     >>> the issue here.  I guess my regex didn't look for non-numerics at the
>     >>> end of the string, which would have brought this up.
>     >>>
>     >>> Is CX supposed to be a currency?  Or a stock?  I'm not sure.  Either
>     >>> way, this is why the number format cannot be parsed by the importer.
>     >>>
>     >>> >     egrep '^T[^-0-9]' file.qif
>     >>> >
>     >>> > 101 matches, but they all have T followed by text, TBank, TInvst,
>     >>> etc.
>     >>> I'm
>     >>> > afraid I'm not familiar enough with these searches to look further.
>     >>>
>     >>> For these I'd have to see the context around these items to understand
>     >>> what it is.  My guess is that it's within the Account List, specifying
>     >>> the Account Type.  I don't see any invalid types here, so that's not an
>     >>> issue.
>     >>>
>     >>> Assuming you haven't completely given up yet, could you remind me the
>     >>> actual QIF import error(s) you were getting?
>     >>>
>     >>> > Mark
>     >>> [snip]
>     >>>
>     >>> -derek
>     >>> --
>     >>>        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
>     >>>
>     >>
>     >>
>     >
>
>     --
>            Derek Atkins                 617-623-3745
>            derek at ihtfp.com             www.ihtfp.com
>            Computer and Internet Security Consultant
>
>

-- 
       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