[GNC] When importing an account tree from a csv file,     account type information disappears

hakon at finne.net hakon at finne.net
Thu Jan 9 07:01:19 EST 2025


(Apologies if I mess up the response format on this mailing list; I 
subscribed to daily digests, so I had to copy-paste from that bundle of 
messages.)

Thanks, Michael, for your prompt response.

The ordering of fields and potential manual edits that you suggest after 
steps a) and b), I had already been through a number of times. However, 
I had not performed your suggestions a) and b) below, so I went through 
those steps this morning. This procedure at first seemed to reveal 
nothing unexpected.

However, in preparing a new file (book) from scratch, I discovered that 
there seemed to be some mixture of English/Norwegian terminologies. 
Since I expected that my problem was related to the English/Norwegian 
issue, I performed the New-file-then-export procedure on two different 
out of the 17 proposed "Categories" of account "ensembles" (my word) 
available for my language version (nb). I first established a new file 
(book) using an ensemble called "Common Accounts", where everything was 
worded in English -- except for the account Type for each account, which 
was worded in Norwegian. The subsequent csv file export of the account 
tree, however, displayed the account Types in ENGLISH UPPERCASE. I then 
repeated the New-file-then-export procedure for an ensemble called 
"Nærings Kontoer", a use case where everything was in Norwegian, 
including the account Type for each account. The subsequent csv file 
export of the account tree, however, displayed the account Types in 
ENGLISH UPPERCASE.

In other words, the export procedure displayed the account Types in 
ENGLISH UPPERCASE, whereas the display of the account Types inside the 
GnuCash book was in Norwegian Sentence case. This held for both the 
"Common Accounts" ensemble (English original) and the "Nærings Kontoer" 
ensemble (Norwegian adaptation of a different set of accounts). So I 
tested four different cases of importing a (selection of) my MD account 
tree (sorry I also erroneously misspelt it MB earlier) into a new and 
empty GnuCash file (book): Norwegian and English account Type names, in 
UPPERCASE and Sentence case. The only case where all the account Types 
were then actually imported, was the combination of English account Type 
names written in UPPER CASE. One interesting anomaly, though: the 
English Bank account Type is worded exactly the same way in Norwegian. 
So in the Norwegian UPPERCASE case import, the account Type for bank 
accounts was correctly imported (even though no accounts had been 
defined yet as ASSET accounts).

I can now proceed with my other problems of changing from my Mamut Datax 
system to a GnuCash system. However, since I have not been able to find 
documentation on the English UPPERCASE requirement for the import (via 
csv) of account Types associated with imported accounts, I hope someone 
could either include that in the documentation or give better pointers 
to where to find it (if it is already somewhere in the documentation). 
Does anyone reading this message pick up this challenge, or should I 
direct it elsewhere -- and if so, where?

-- Håkon

Message: 7
Date: Wed, 8 Jan 2025 18:28:33 -0500
 From: Michael or Penny Novack <stepbystepfarm at comcast.net>
To: gnucash-user at gnucash.org
Subject: Re: [GNC] When importing an account tree from a csv file,
     account type information disappears
Message-ID: <0c4e7607-5a9a-4511-8048-d514111b3812 at comcast.net>
Content-Type: text/plain; charset=UTF-8; format=flowed

On 1/8/2025 5:52 PM, hakon at finne.net wrote:

> I am a new GnuCash user. I have several problems when trying to import
> an account tree from an accounting program (Mamut Datax) I have used
> before. One of these problems can be described as follows.
> 
> I export the account structure from my MD system to a csv file. I then
> use MS Excel to restructure the information to fit the input
> requirements for a csv file that will define a GnuCash account tree.
> During the import to GnuCash, I assign my MB Account Type field to the
> Type field of GnuCash. Once imported, the account tree looks ok,
> except that the Type field for each account is empty. It does not
> matter whether I use the original US Type typology or the built-in
> Norwegian Type typology. I understand that a subaccount cannot be
> assigned a Type that is not compatible with the account above it in
> the tree, all the way up to the five fundamental account types. And I
> make sure the sequence of accounts in the csv file defines the
> hierarchy top-down (should it matter). Please help me sort this out.
> Assigning account Types manually after the import is possible, but I
> would rather solve this in a more automatic manner.
> 
> -- H?kon

I've done this sort of thing several times in my working days, so can
see you are leaving out a critical step (when migrating between 
databases)

a) FIRST do an export from your DESTINATION and make sure you can import
that back in (in this case to another instance of gnucash books)

b) DID that work? Did everything you expected to see appear where it 
should?

NOTE: These first two steps are to isolate potential problems. If an
issue shows up doing "a" and "b" it would show up going data source to
data destination no matter how perfect you did the rest and you'd be
looking for the problem in the wrong place. In other words, skipping
those first two steps only looks like it saves time. In practice, will
save much more head scratching time later.

c) OK, you NOW look at the format (of that export from gnucash) using
your favorite editor? See where all the fields are? All .cvs means the
fields are delineated by commas, NOT that their order is correct. Now
you look at your export from MB. Not likely in the same order. You'll
possibly need to write something to fix if no "reorder tool" available
<<here I'd always be doing that, roll my own, then leave that in a
department library as a tool >>

NOTE: If there is SOMETHING in the gnucash export you can't find in the
MB export may have to fill in manually.

Michael D Novack


More information about the gnucash-user mailing list