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

Importing QIF

Tags: None
(comma "," separated)
zebulon
Registered Member
Posts
417
Karma
2
OS

Re: Importing QIF

Sun Jan 23, 2011 10:32 pm
Most likely, the problem is in the header though. You could put the first 15-20 lines or so in a new .qif file and try importing that. Make sure you have a complete operation and a final caret at the end. If that works, you can do a binary search: split the file after the middlemost operation. Import the top part.

- If it fails; split it again, keeping only the first quarter.
- If it works, import the first half of the rest, etc.

This is really fast. Keep a backup copy of your original file first. Make sure the header is the same every time and there is always a caret at the end. If you need to delete all operations from the ledger, select all at once using ctrl-A.
Fugger
Registered Member
Posts
17
Karma
0
OS

Re: Importing QIF

Mon Jan 24, 2011 7:27 pm
Next evolution... does better, but kmm seems to have difficulties to sort dividends. Kmm creates a cash account for each portfolio. Dividends are transfered directly from the portfolio to a bank account while they also appear in the cash account. Can anybody confirm? Any Idea how to get rid of it?

This is probably one of the last mistakes while this works quite well with most regular accounts and some portfolios as well:

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/
}
/^!Type:/{
  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/
  s/VersAus/MiscExp/
  s/VersEin/MiscInc/
}
zebulon
Registered Member
Posts
417
Karma
2
OS

Re: Importing QIF

Tue Jan 25, 2011 1:22 am
Investment accounts cannot contain cash. You should really create a brokerage account for every investment account to handle cash. If you create an investment account, the gui asks if you want it. I think it is not possible to add it afterwards. I suspect your QIF file does not specify where the interest needs to go. KMM will send it to the brokerage account, but there is also a line in the Investment account ledger. This is OK though, as it the latter just represents the operation, not the amount. Here is what the QIF for a dividend should look like
!Type:Invst
D12/21/10
T12.34
NDiv
YIBM
I
Q
^

I am not sure if the regexp /^!Type:/ in your sed file is correct though. Maybe you mean /^Type:/! which matches all lines that do not start with the string Type:
If you do not want to substitute on lines starting with Type:, you can replace the first string /^T/ by /^T\>/, indicating you want a T in the first column that is also the end of a word.
Fugger
Registered Member
Posts
17
Karma
0
OS

Re: Importing QIF

Wed Jan 26, 2011 7:26 pm
Hi Zebulon,

thanks for the hint ... it seems the problem is with DivX, SellX etc. If money gets transferred directly from investment to another bank account, then probably the booking from the equivalent transfer in the bank account is booked to the brokerage account. So I got rid of all DivX etc. -> made them to normal Div. This Works.

BUT With SellX -> Sell kmm does not ignore the L line and treats it as SellX

Can you give me a RegExp that deletes the L Line in i.e. a SellX like this?

D6.16.10
NSellX
YBerliner Volksbank Genossen
I52
Q1.04
U54.08
T54.08
MSch�tzpreis 16.06.10
L[Vb Mittelhessen]
$54.08
^

Thanks in advance
zebulon
Registered Member
Posts
417
Karma
2
OS

Re: Importing QIF

Thu Jan 27, 2011 12:56 am
Hi,

I don't have SellX, but I did have DivX. Here is an example that posed no problem for me
D7/13/01
C*
M Comment
T44.82
L[Not_Brokerage_Account_Name]
$44.82
NDivX
YGoogle
I
Q
L[Not_Brokerage_Account_Name]
Anyway, as for your sed request, this should work:
/^NSellX/,/^^/{/^L/d}
Some explanation: I define a range of lines between two strings. The start of the range is a line starting with "NSellX", and the end of the range is a line starting with a caret (the caret itself represents the start of the line, but two carets can only mean one thing). In this range, I delete any line starting with "L".
Fugger
Registered Member
Posts
17
Karma
0
OS

Re: Importing QIF

Mon Jan 31, 2011 8:58 pm
Advancing... rearranging...

need your help again with RegExp

comma2dot does what it says, but... if its more then a 1000

Q1.243,2069

konverts to

Q1.243.2069

instead of
Q1243.2069
or
Q1,243.2069

I need to kill existing points before or transfer to comma (but then not convert again, of course)

It seems I am having this in just one case - but if this is going to be a filter for others also... we`d better make it right
zebulon
Registered Member
Posts
417
Karma
2
OS

Re: Importing QIF

Mon Jan 31, 2011 11:56 pm
Replace the original substitute command by this:
Code: Select all
/^[IQ]/{
  s/\.//g
  s/,/./
}
It will remove all periods before converting commas.
I added the "g" option for numbers over one million which may have two dots.
Fugger
Registered Member
Posts
17
Karma
0
OS

Re: Importing QIF

Wed Feb 02, 2011 8:39 pm
Success!

did you know, that there are transactions in the quicken ledger, that do not appear in an qif export? Seems to happen with transactions that are left in remaining accounts when you delete another account.

Here are my lessons learned:

Create your investment accounts and securities (do not leave identifiers empty, if you do that by generating an qif file by hand)

Export qif from quicken (all accounts, all trancactions, all categories in one file)

konvert the exported file with sed

Code: Select all
/^[IQ]/{
  s/\.//g
  s/,/./
}
/^T/{
  s/Oth T/Bank/
  s/Oth S/Bank/
  s/Oth F/Bank/
  s/Oth A/Bank/
  s/Oth P/Bank/
}
/^!Type:/{
  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/
  s/VersAus/MiscExp/
  s/VersEin/MiscInc/
  s/ZinsEin/IntInc/
}


import the konverted qif
ignore all messages "Konto Account has invalid type" but take care for all others.
investment accounts get doubbled
and one of the cash accounts will have double transactions - take look wich accout is unecessary and delete all transactions in it.

that`s it, basically. I had to do a lot of cleansing in my old quicken transactions, though (see above).

I would suggest that the german identifiers for investment transaction get into the code of kmm. The strange comma and dot usage in the fields is probably specific to german quicken 2008. I suggest to deliver the IQ section of the filter as an specific filter "german quicken 2008" with kmm , so everybody could try if this option does any good for them. Is there a way to get this sarted?

AND Thanks a big lot, Zebulon!


Bookmarks



Who is online

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