Getting Started

James A. de Haseth jdehaseth at snappydsl.net
Tue Feb 6 12:27:46 EST 2007


On Mon, 2007-02-05 at 22:31 +0000, David Keegan wrote:
> Is it possible to use QIF (or some other) import to set up the initial
> Account Hierarchy?
> 
You can create the original account hierarchy if you edit your QIF file.
This is not as hard as it may seem.  I am in the middle of taking a very
messy account system with 1000's of transactions, 10's of accounts, and
15 yrs of data, from InCharge to GC via QIF files.  There are
challenges, but it's not too bad.

I break the QIF files into separate account files.  The structure of
each account will be a text file, e.g. Checking.QIF, of the general
form:

!Account
NChecking
TBank
^
!Type:Bank
<followed by the transactions>

First you want to convert the second line to:

NAssets:Current Assets:Checking

if that's your hierarchy.

Each transaction may have a budget or account code, e.g. VISA, in the
form LVISA

You may want all VISA transactions, i.e. paying your card balance, in
the hierarchy, so write a sed script, sedscr:

s/LVISA/LLiability:Credit Cards:VISA/

you can add all your budget codes to the script, e.g.

s/LGroceries/LExpenses:Groceries/

When the script is complete, run the command:

sed -f sedscr Checking.QIF > CheckingGC.QIF

Then import CheckingGC.QIF.  You'll see the new hierarchical accounts,
just accept them and off you go.

Of course, YMMV, and there will be instances that will not be easily
converted.  You will probably end up with an Unspecified account.  You
can generally be creative with sed to correct this and get most of the
problems.  Some hand editing of the QIF may be necessary, but with work,
you can get a very clean import.

Hope this helps,

Jim





More information about the gnucash-user mailing list