Registered Member
|
I am having an issue importing a CSV file into KMyMoney. I'm using the File -> Import process. It all goes well until I get to the final page and it announces that the date format is wrong. The date format in KMyMoney is yyyy-mm-dd and the date format in the csv file is also yyyy-mm-dd. I can't understand what the error could be. Has anyone seen this kind of behaviour an does anyone know what might be causing this? The importer ddefailts to m d y (no punctuation), so I change it to y-m-d. Could that have anything to do with it?
Thanks for any help. |
Registered Member
|
I am seeing something similar with csv import using kmymoney-5.1-179-linux-64-gcc.AppImage .
The date I am trying to import is like "01 JAN 2022", and I have selected "d m y" in the date format dialog, but it refused to accept it and thus I cannot import the file. I manually edited the file and changed "01 JAN 2022" format to "01-01-2022" format and it worked, so I suspect the plugin has a parsing problem with dates. Interestingly the example banking import in the docs has a date like the one that doesn't work. |
Registered Member
|
Some possible solutions at https://forums.linuxmint.com/viewtopic. ... 7&t=372215
The QIF importer doesn't seem to have this problem. Is it an option to convert the CSV to QIF format ?. Some tools: https://pypi.org/project/csv2ofx/ https://github.com/M-tech-Creations/CSV-to-QIF https://www.matthijsmelissen.nl/qif-converter/ https://www.converthelper.net/csv-to-qif http://xl2qif.chez-alice.fr/xl2qif_en.php https://answers.microsoft.com/en-us/mso ... 1d89cd404b I cannot vouch for any of the above tools; use at your own risk.
Currently running Kubuntu 22.04, Plasma 5.24.4, Frameworks 5.92.0, Qt 5.15.3, kernel 5.15.0-46-generic (64-bit), GeForce 840M Graphics
|
KDE Developer
|
I tried to duplicate this here by modifying a file. I was unable to duplicate the problem using kmymoney-5.1-159-linux-64-gcc.AppImage and kmymoney-5.1-274-linux-64-gcc.AppImage. Here's my CSV testfile:
Note: The above is contained in two lines. Settings of my Banking profile:
Can you import this sample data?
ipwizard, proud to be a member of the KMyMoney forum since its beginning.
openSuSE Leap 15.4 64bit, KF5 |
Registered Member
|
I downloaded the test data and got the same error. I created a new KMM file and a bank account, then tried to import the csv into it. It stops at the same place complaining about the date. I grabbed a few screenshots located at the following link:
https://drive.google.com/file/d/1tOArP9 ... share_link When I setup a the new KMM file and bank account I used my home country (Canada) if that matters. |
KDE Developer
|
Can you try to import the test data file using the latest KMyMoney version? I added some debug output for the failure which is printed to the terminal window as soon as you press Next on the page with the column selections. I would appreciate if you can provide them to us. Thanks in advance.
If everything works as expected, it prints
In your case, it could be more and different output and this one may be missing at all.
ipwizard, proud to be a member of the KMyMoney forum since its beginning.
openSuSE Leap 15.4 64bit, KF5 |
Registered Member
|
I downloaded kmymoney-master-292-linux-64-gcc.AppImage and did some testing. STDOUT from the tests is file kmm-debug.txt included in the following ZIP file of results located at https://drive.google.com/file/d/1Q-7y_Y ... share_link
It looks like the csv importer is getting confused by the month conversion in the local character set based on the following messages in STDOUT:
I edited field 6 of the .csv file and tried "Jan" "Jan." without success. However when I changed date to "01 MAY 2022" or "01 May 2022" the importer worked. I suspect "January" would also work. It looks like the "." character in the translation table is causing the importer to fail. |
KDE Developer
|
I see the problem: The columns in the list of month names contain the output of
1. QLocale::standaloneMonthName(ShortFormat), 2. QLocale::monthName(ShortFormat), 3. QLocale::standaloneMonthName(LongFormat), 4. QLocale::monthName(LongFormat). If I run this on my system I get
Don't worry about the error message that it did not find JAN. That is because I forced it to fail to get this list. The problem is, that the standaloneMonthName method in my locale does not append a dot when used with option ShortName. Passing "Jan." (with the dot) in one of your tests fails, because the dot is removed before the comparison happens (the dot is a separator). I made some more changes. You can try the latest build which should solve the problem.
ipwizard, proud to be a member of the KMyMoney forum since its beginning.
openSuSE Leap 15.4 64bit, KF5 |
Registered Member
|
I downloaded kmymoney-master-296-linux-64-gcc.AppImage and reran the test. It now works. STDOUT loog shows:
Thanks for fixing this. Greg |
KDE Developer
|
Thanks for the feedback. I also added the fix to the stable branch of the application.
ipwizard, proud to be a member of the KMyMoney forum since its beginning.
openSuSE Leap 15.4 64bit, KF5 |
Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]