GnuCash User Manual
<<< Previous | Importing Quicken Data Into GnuCash | Next >>>

# Introduction to the QIF file

QIF files are plain text files formatted as "tag-value" pairs. At the beginning of each line there is a single character "tag" followed immediately by the "value", which extends to the end of the line.

Don't be afraid to pop up a QIF file using `less` or the text editor of your choice if you are having problems getting some Quicken data imported correctly; chances are a simple search-and-replace can fix just about any problem you might have with a QIF file. And a regexp search-and-replace will get the rest.

Collections of tag-value pairs form records of various types. There are records to store the names and descriptions of your accounts and of expense and income categories that you have defined in Quicken. There are records to define Quicken "classes" (sort of like sub-accounts, sort of like categories, but not exactly like either). And there are records to describe transactions.

Here's a typical Quicken transaction record: ``

!Type:Bank
D6/20/97
T-500
N1012
C*
M
P
L[Visa]
^

The ! tag denotes the start of a section of records of a certain type. In this case, Bank transactions. Type:Cat means a section of Category descriptions, Account means account descriptions, and so on.

The D tag denotes the date. Note y2k compliance "issue". Here's a lovely "feature" of some version of Quicken and dates in 2000: ``

D1/ 1' 0
T-640.00
CX
N511
PJoe Bob
LRent:Apartment
^

Ouch! Fortunately the GnuCash QIF importer can handle all of the wacky date formats that the gnucash-devel list can find.

The T field is the "Total" amount of the transaction. If there are splits, the sum of all the split amounts is in a T field. Money going out of the account is negative.

The N field is a "Number", which is usually a check number or some other identifying number for the transaction.

The C field represents the clearing/reconciliation state of the transaction. An x or X in this field means the transaction is "Cleared", a * means the transaction is Reconciled.

The M field is the transaction memo.

The P field is the Payee.

The L field is the Category/Account line. If the value in this field is enclosed in square brackets, like [Visa], this transaction is a transfer to the Quicken account named Visa. If there are no square brackets, the transaction is in the named Category (like Rent:Apartment).

The ^ tag means End of Record.

Quicken users taking advantage of Classes will see a slash (/) character followed by the class name appended on the Category line (like [Visa]/Project)

If a transaction has "splits", meaning that it is a single transaction with "this" account but is "split" into multiple source/destination accounts, the splits are described with S fields for the category/account/class of each split, an $ field for the amount of the split, and an E field for a per-split memo. The total of all the $ fields in a transaction record should equal the T field.

Note that nowhere in the transaction record, nor anywhere else in the file, does Quicken store the name of the account that the file describes. Don't ask me why not, I don't know either. Microsoft Money (which also can save QIF files) uses a "trick" to get the information in the file. If the very first Bank transaction in the file has a payee of "Opening Balance", the L line contains the name of the account that the file describes: ``

!Type:Bank
D12/03/95
T4,706.57
CX
POpening Balance
L[New Bank]
^

Opening Balance records are handled specially, since they don't mean what the data appear to indicate (if you interpret the record literally, as a transfer of $4706.57 from [New Bank] to [New Bank], your new balance is a whopping $0.00). In the Accounts Tab section there's a discussion of what we do with them.

## Multi-account Quicken exports

Quicken and some other programs who use QIF as an export format know how to put the history of multiple accounts into a single QIF file. They do this by prepending an "!Account" record before the set of transactions to/from that account.

The QIF Importer should be able to handle these files fine. You may notice that the "Default QIF Account" seems somewhat arbitrary; for multiple-account exports, the guessed account is the first one with an Opening Balance record. However, since Quicken explicitly lists the account for every transaction in multi-account exports, you aren't likely to get any transactions in the default account other than those that are supposed to be there.

<<< Previous | Home | Next >>>
Importing Quicken Data Into GnuCash | Up | How to use the QIF Import dialog