This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Importing QIF

Tags: None
(comma "," separated)
gavanhe
Registered Member
Posts
1
Karma
0
OS

Importing QIF

Sun Dec 19, 2010 7:01 am
Hi all
After importing a QIF file, the amounts are out by a factor of 100 ie. instead of my accounts being of the order of thousands they are now millions. I have checked the QIF with a file viewer and they appear to be correct. So how does one over come this problem perhaps with a QIF filter?
I'd love to be a millionaire but am not!
Thanks in anticipation for a resolution.
Cheers
Gerry
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS

Re: Importing QIF

Sun Dec 19, 2010 9:14 am
Does your file start with a line containing !type (case does not matter) ? Here's a sample

!Type:Bank
D5/23'2000
T0.00
CX
POpening Balance
L[Everbank Checking]
^
D5/23'2000
CX
T0.00
POpening Balance
^


Alternatively, !account is another valid start. If none of them is present, KMyMoney cannot auto detect the decimal separator and thus all numbers come out to big by a factor of 100.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
Fugger
Registered Member
Posts
17
Karma
0
OS

Re: Importing QIF

Tue Jan 04, 2011 6:49 pm
No, Puttin a !Account in Front does not change anything - exept that kmm doesn`t ask for the account to add the transactions:

!Account
NDWS Aktivio X041793202
DCasius Finanz
TInvst
^
!Type:Invst
D12.13.10
NSell
Y5936X M&W Privat
I143,048726
Q5,5925
U800.00
T800.00
^

Is imported with 55925 papers with a price of 0,0143€ (so the amount of money spend is correct).

I guess that my german quicken exports dot and colon the german way an kmm imports it the american way - but only in I and Q fields. U and T use a dot to seperate the fractions... If I change the colons to dots in I and Q line it gets imported as it should.

Is there a special qif importer for german users?

yours
fred
zebulon
Registered Member
Posts
417
Karma
2
OS

Re: Importing QIF

Wed Jan 05, 2011 3:57 am
You should be able to define a new QIF import profile, with input filter

sed -f comma2dot

with comma2dot containing:

Code: Select all
/^[IQ]/s/,/./


You have to use the sed file; you cannot just use sed '/^[IQ]/s/,/./' as a filter. And, you have to create a new filter (select New in the QIF Profile Editor and assign a name to it).

As you pointed out, your Quicken export seems inconsistent, for it uses decimal points in the U and T lines and not in the I and Q lines. Strange.
Fugger
Registered Member
Posts
17
Karma
0
OS

Re: Importing QIF

Wed Jan 05, 2011 8:45 pm
Thanx Zebulon! This is what I am looking for.
Since I need to do some other changes in the qif as well ... Quicken uses some german words in the securities section that need to be changed, too. (NKauf -> NBuy NVerkauf -> NSell). THis way I can put everything in a file that others can use,too.

However - I did not get it to work (no time today), probably the comma2colon needs to be in a specific directory (other than the kmy or qif)?
zebulon
Registered Member
Posts
417
Karma
2
OS

Re: Importing QIF

Wed Jan 05, 2011 10:30 pm
Yes, it took me half a dozen tries as well.. I put the sed file in my home directory, but that is also where my .kmy file is. I do know that

sed -f ~/comma2dot
sed -f $HOME/comma2dot

both do NOT work. I only got it to work with no pathname and with a full, explicit pathname.

It seems that you know your way with sed. If not, just post what you want to do.
Atea
Registered Member
Posts
4
Karma
0
OS

Re: Importing QIF

Fri Jan 07, 2011 5:24 pm
are there any usefull informations for the settings of a new QIF import profile? I checked the handbook, but there were no usefull informations about the filters, and so on.....

Thanx
zebulon
Registered Member
Posts
417
Karma
2
OS

Re: Importing QIF

Sat Jan 08, 2011 1:44 pm
Did you see this? Is it insufficient?
Fugger
Registered Member
Posts
17
Karma
0
OS

Re: Importing QIF

Sat Jan 08, 2011 4:03 pm
zebulon wrote:It seems that you know your way with sed. If not, just post what you want to do.


No I don`t know sed, but I am optimistic to handle it (http://www.grymoire.com/Unix/Sed.html gives a good introduction). However, here is what I know so far that needs to be done (thanks to the guys from gnucash). I´ll be lots slower than you are and if you give me an example for some of those I´ll be quicker with the rest. It may be better to integrate those into the code, but having a filter file for german quicken versions is a good way also, I think:

NAktSplit -> NStkSplit.
NAktzu -> NShrsIn
NAktab -> NShrsOut
K.gewsp -> NCGShort
NK.gewspX -> NCGShortX
NKapgew -> NCGLong
NKapgewX -> NCGLongX
NKauf -> NBuy
NKaufX -> NBuyX
NVerkauf -> Sell
NVerkaufX -> SellX
zebulon
Registered Member
Posts
417
Karma
2
OS

Re: Importing QIF

Sat Jan 08, 2011 5:14 pm
You just pile up all your substitutions:
Code: Select all
/^[IQ]/s/,/./
s/NAktSplit/NStkSplit/
s/NAktzu/NShrsIn/
s/NAktab/NShrsOut/
s/NK\.gewsp/NCGShort/
s/NKapgew/NCGLong/
s/NKauf/NBuy/
s/NVerkauf/NSell/
I removed some lines because they are redundant in the first place, and would actually cause trouble because of double substitution, like NNCGShortX. A bit fancier:
Code: Select all
/^[IQ]/s/,/./
/^N/{
  s/AktSplit/StkSplit/
  s/Aktzu/ShrsIn/
  s/Aktab/ShrsOut/
  s/K\.gewsp/CGShort/
  s/Kapgew/CGLong/
  s/Kauf/Buy/
  s/Verkauf/Sell/
}
Fugger
Registered Member
Posts
17
Karma
0
OS

Re: Importing QIF

Mon Jan 10, 2011 7:44 pm
Thanks, again - Zebulon. I didn`t get the importfilter to work, but I am starting sed in a terminal and I konvert my file before importing it.

The list of necessary exchanges is already longer and kmymoney gets closer and closer to an import of my data. I´ll be posting my findings or questions on the way.
Fugger
Registered Member
Posts
17
Karma
0
OS

Re: Importing QIF

Sun Jan 23, 2011 4:15 pm
Here is as far as I got. Somehow changing the accounts into known types does not change the error Messages "unknow type of account". And while it has gotten lots closer to the desired result, I still have very strange effects in somme accounts. It would help, if kmm would not give the error but also the line number and the line, the error pops up.

Code: Select all
/^[IQ]/s/,/./
/^T/{
  s/Oth T/Bank/
  s/Oth S/Bank/
  s/Oth F/Bank/
  s/Oth A/Bank/
  s/Oth P/Bank/
}
/^N/{
  s/AktSplit/StkSplit/
  s/Aktzu/ShrsIn/
  s/Aktab/ShrsOut/
  s/K\.gewsp/CGShort/
  s/Kapgew/CGLong/
  s/Kauf/Buy/
  s/Verkauf/Sell/
  s/XEin/XIn/
  s/XAus/XOut/
}
zebulon
Registered Member
Posts
417
Karma
2
OS

Re: Importing QIF

Sun Jan 23, 2011 4:50 pm
Do you want the accounts to be created upon importing or did you create all accounts first? I'd definitely recommend the latter.

"Oth A" is an asset account and "Oth L" is a liability account. I would not translate those to "Bank". I would hope KMM knows about them as is.

Do you have a dummy example (headers, 1-2 operations) that does not import?
Fugger
Registered Member
Posts
17
Karma
0
OS

Re: Importing QIF

Sun Jan 23, 2011 8:19 pm
Hi Zebulon,
I did create all Accounts first - manually (and all securities, too. Kmm doesn`t create them, it simply complains.

I do not have 1 or 2 liners - my file is quite big (10 Years). That ist why I want line numbers in the errormessages. I have the accounts seperated in smaller files, but that doesnt help a lot.

I` Try without the ^T section again. So far it does not seem sucessfull at all.
Fugger
Registered Member
Posts
17
Karma
0
OS

Re: Importing QIF

Sun Jan 23, 2011 8:39 pm
The ^T section makes a difference for the better. I have to see which parts, but kmm does not know about all the Oth accounts, that I have. Too late now, but I'll be back nxt weekend.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]