GNOME Bugzilla – Bug 141003
QIF: Number format with currency symbol in
Last modified: 2018-06-29 20:43:03 UTC
The qif format produced by one of my on-line credit card accounts puts a currency symbol (the GBP pound sign '£') in the numbers. GnuCash fails to import these files. It would be nice if it worked, rather having to modify the qif files by hand first. A sample qif file looks like: !Type:CCard D21/04/2004 T-£10.50 PTHE SHOPPING CENTRE ASOMEPLACE AGBR A N ^
Hmm, I thought this worked, but perhaps it only works with '$' and not '£'.
Is this still a problem?
Well, it isn't a problem for me anymore, since I no longer have the credit card whose on-line servicing produced these qif files. However, doing a quick test on 1.9.4 with the sample I gave fails to import (QIF file parse failed: Data for number or date does not match a known format.), so it may still be a problem for some people.
Yeah, this code hasn't changed at all, so it's no surprise that it's still a problem. I suppose I could try to make the regex ignore any non-digit characters.
I just started looking into this and, unfortunately, it's much more challenging that I first anticipated. Just updating the regex is not sufficient, because while it uses the regex to determine what KIND of number it is, it doesn't use that regex to actually parse the number out. So while it can ignore '$', that is fairly hardcoded into a number of different places, and making that a variable would be some major surgery. :( So, I'm not going to be able to do this right now like I thought I could. I'll leave it open for later.
This has been reported as a problem again (bug 550176). Apparently TSB (UK) bank does this in their credit card statement downloads. Fix committed as r17489. Requesting backport for 2.2.
Better hold off on backporting this patch. Dave Reiser has reported a problem with this patch (see the -devel mailing list). Mac OS X 10.5.4 gcc 4.0.1, autoconf 2.62 (2.63 readily available), automake 1.9.6 (1.10.1 readily available) guile 1.8.3
I have this bug in version 2.2.7. When I download from Capital One in the UK the currency symbol is the £ and the import fails. Amending the £ to $ in the downloaded QIF file solves the problem. I used WordPad the perform the change. No problem but it would be a worthwhile change when next updating GnuCash.
Chris, Yes, it would be nice, but unfortunately it doesn't work. See comment #7. Until we can actually verify that the change works in all environments it would behoove us not to ship with this patch. In particular, on OSX it caused a fatal crash at GnuCash start time, even if you dont try to import a QIF File. Part of the issue is charset encoding. The £ symbol isn't ASCII, so does the character need to be Latin-1 or UTF8? Unfortunately Guile isn't clear on what its input should be, so you have a problem that different systems require a different locale for the encoding of the Scheme files. Now, one approach to fix it would be to encode some of that RegEx code in C, but I don't know how hard that would be.
Comment #7: Check the mailing list archives for more discussion on this. Bottom line is that the fix for bug 141002 is has been separated and it waiting for backport, but a fix for bug 141003 is not ready. Actually I had a redesigned fix nearly working, but my PC encountered hardware problems and trunk also refused to compile on Windows (for unrelated reasons), so that code is sitting on a broken PC on the other side of the world. I won't get another chance to look at it for a few months.
Has there been any movement on this? I just downloaded 2.4.8 to try managing the archive of old exports I have and all my Capital One QIF files have pound signs in them....this is going to be a right pain :(
Nope, no movement. In the interim you can run: sed -i -e 's/£//g' file.QIF which will remove all instances of the pound symbol. Then import.
GnuCash bug tracking has moved to a new Bugzilla host. The new URL for this bug is https://bugs.gnucash.org/show_bug.cgi?id=141003. Please continue processing the bug there and please update any external references or bookmarks.