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

CSV import: separate debit and credit columns

Tags: None
(comma "," separated)
User avatar
dotancohen
Registered Member
Posts
59
Karma
0
OS
How does one configure the CSV import to support separate debit and credit columns? Both columns use positive numbers. I've looked under `Settings -> Configure Skrooge -> Import / Export -> CSV` but I only see a unified "Amount" column option.

I would prefer to not have to preprocess the CSV with Python as I need to deploy this to a user for whom that would complicate the workflow considerably.

Thank you.


dotancohen, proud to be a member of KDE forums since 2008-Oct.
User avatar
smankowski
Moderator
Posts
1047
Karma
7
OS
Hi,

If you have CSV with 2 columns for amounts like this:
Code: Select all
date;debit;credit;comment
1/1/2011;1,000.50;;first entry
2/2/2011;;2,000.50;second entry
3/3/2011;0;500;third entry


If you use the automatic detection of header or if you set the setting like this:
Code: Select all
date|amount|amount|comment


The import will be done correctly.
Regards.


Skrooge, a personal finances manager powered by KDE
Image - PayPal
User avatar
dotancohen
Registered Member
Posts
59
Karma
0
OS
Thank you. I've tried setting the CSV import as such:
    * No automatic search of the header
    * No automatic search of the columns
    * Column positions: date|mode|comment|idtransaction|amount|amount|||
    * Debit values of "sign" column: ^-|^debit|^withdrawal

When importing the file, Skrooge is crashing with only this CLI output:
Code: Select all
$ skrooge
##WARNING: libpng warning: iCCP: known incorrect sRGB profile
##WARNING: libpng warning: iCCP: known incorrect sRGB profile
Segmentation fault (core dumped)

This is what the top of the CSV file looks like:
Code: Select all
$ head -n 2 bank.csv
תאריך   ,סוג פעולה,תיאור,אסמכתא,זכות,חובה,תאריך ערך,יתרה
23/05/2019,162,7631856 משיכת שיק,7631856,                     ,3500,23/05/2019,553.82

In order, those column names could be translated as:
date, action type, description, transaction id, credit, debit, value date, balance

The file is in UTF-8 text. Note that the date format is not a date format that one can set in Skrooge, so I've set the date as automatic detection.

I also tried setting the date format as MM-DD-YYYY and using a test CSV file with dates in that format, but Skrooge still crashed.

I also tried setting the header position to 0 and using a test CSV file with the header row removed, but Skrooge still crashed.

After reading page 23 of this PDF I added a column "account" to each row with the proper account number, and configured the columns to find it, but Skrooge still crashed.

I tried setting the columns to "account|date|comment|amount|amount" and creating a test CSV file:
Code: Select all
112590,23-05-2019,Foo,,3500
112590,22-05-2019,Bar,,2500
112590,22-05-2019,Baz,,63.77
112590,22-05-2019,Boom,3500,
... however Skrooge still crashed.

Using Skrooge 2.11.0 on Kubuntu 18.04, installed from the distro package manager. This machine is running KDE Plasma 5.12.7, KDE Frameworks 5.44.0, and Qt 5.9.5.


dotancohen, proud to be a member of KDE forums since 2008-Oct.
User avatar
smankowski
Moderator
Posts
1047
Karma
7
OS
Hi,

Crashes are not normal.
I'm not able to reproduce them on last version.

First, you should install the last version by using my ppa (see: https://launchpad.net/~s-mankowski/+arc ... tu/ppa-kf5).
Could you try to replace "," by ";" in csv file?
I did the test with this and the result is good:
Code: Select all
112590;23-05-2019;Foo;;3500
112590;22-05-2019;Bar;;2500
112590;22-05-2019;Baz;;63.77
112590;22-05-2019;Boom;3500;


Skrooge, a personal finances manager powered by KDE
Image - PayPal
User avatar
dotancohen
Registered Member
Posts
59
Karma
0
OS
Thank you so much Stephane! In fact I could get your CSV file to import correctly (including debit/credit columns).

I will do some experimenting to see at what point the CSV file is not longer importable. Thank you.


dotancohen, proud to be a member of KDE forums since 2008-Oct.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Evergrowing, Google [Bot], rblackwell