I recently had the brainfart idea that making a QIF importer for TFM was a good idea. For those of you not in the know, a .QIF is a "Quicken Interchange Format" file. It's simply a list of transactions.
Or is it?
Hah, it isn't. You can also store categories, accounts, arbitrary data, etc, in it. And the best part is that none of this is really standard. The format has no formal layout; you can pretty much stash things into the file any way you please. It gets better, because there is no standard date format or currency denotation.
When I examined my first .QIF file, I thought "well this should be easy!". Dates, for example, were formatted MM/DD/YY. Easy enough.
So I went into Quicken to export some data, just to see if it does anything different than my bank. It spit out a file that looks almost nothing like the one my bank gave me.
The most WTF thing ever: dates were formatted like this:
:mM 'dD /yY
For example, today would look like:
":3 ' 9 / 6"
What. The. Hell?!
Since when is that a valid date format... anywhere?!
Not wanting to give up after hopelessly comming to the conclusion that a homebrewed solution is going to be significantly more difficult than I originally anticipated, I decided to take a look at GNUCash's implementation of a QIF importer.
Hahahaha. Hoh boy. Not only does it mix C++ and Scheme and Regex code altogether in one giant mess, they use huge undocumented macros all over the place, and have even typedeffed their types into oblivion.
gboolean? Come on! I mean, yeah, it's a good idea to typedef types in case you're going to different platforms where the bitsizes are different (though to be honest, I've never actually run into this; and it seems like a purely academic exercise in reality)... but typedeffing a boolean? What, are you afraid that someday someone's going to port your program to a system that supports Filenotfoundian logic?
So anyway, I've given up on QIF's. I may come back to it someday if I ever find a pressing need to be able to import them, but for now... it's just too ridiculous, and I'd rather not fan the flames by supporting an idiotic file format any further.
Just finished invoicing for the pay period, actually. Yay me.