Bug 332396 - CSV import skips last transaction when no trailing newline is present.
Summary: CSV import skips last transaction when no trailing newline is present.
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.6.3
Platform: Kubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-21 11:02 UTC by hironiemus
Modified: 2014-03-21 13:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Test file as described in the bug. (54 bytes, text/plain)
2014-03-21 11:05 UTC, hironiemus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hironiemus 2014-03-21 11:02:25 UTC
When a ledgers csv file is imported in kmymoney and the file ends with a line containing a transaction this line will be omitted. When a newline is added to the same file it will import alright.

Reproducible: Always

Steps to Reproduce:
1. Create a file named test.csv containing only a single line like this:
21.03.2014,State Lottery,Congratulations, 5000000.00
2. Open with File → import → CSV and set the columns and parameters accordingly.
3. Import
Actual Results:  
Kmymoney will report it has imported 0 transactions without asking for an account and set the last line in the dialog to 0.

Expected Results:  
A dialog asking for the account should pop up and then 1 transaction should be imported to this account.
Comment 1 hironiemus 2014-03-21 11:05:10 UTC
Created attachment 85663 [details]
Test file as described in the bug.
Comment 2 allan 2014-03-21 11:17:19 UTC
On 21/03/14 11:02, hironiemus@gmail.com wrote:
> https://bugs.kde.org/show_bug.cgi?id=332396
>
>              Bug ID: 332396
>             Summary: CSV import skips last transaction when no trailing
>                      newline is present.
>      Classification: Unclassified
>             Product: kmymoney4
>             Version: 4.6.3
>            Platform: Kubuntu Packages
>                  OS: Linux
>              Status: UNCONFIRMED
>            Severity: minor
>            Priority: NOR
>           Component: general
>            Assignee: kmymoney-devel@kde.org
>            Reporter: hironiemus@gmail.com
>
> When a ledgers csv file is imported in kmymoney and the file ends with a line
> containing a transaction this line will be omitted. When a newline is added to
> the same file it will import alright.
>
> Reproducible: Always
>
> Steps to Reproduce:
> 1. Create a file named test.csv containing only a single line like this:
> 21.03.2014,State Lottery,Congratulations, 5000000.00
> 2. Open with File → import → CSV and set the columns and parameters
> accordingly.
> 3. Import
> Actual Results:
> Kmymoney will report it has imported 0 transactions without asking for an
> account and set the last line in the dialog to 0.
>
> Expected Results:
> A dialog asking for the account should pop up and then 1 transaction should be
> imported to this account.
>

Yes, thanks.

I fixed that bug last December, (......Also, fix inability to import 
last line of CSV file if it has no return character.), so it is not yet 
in a stable release, only in the development branch - Git HEAD.  There 
will be a new stable release this summer, but then the distros have to 
incorporate it.

It's possibly worth your while to move to 4.6.4 (Claydoh PPA) as several 
other bugs in KMM have been fixed.

Allan
Comment 3 hironiemus 2014-03-21 11:45:53 UTC
Alright, thanks for the quick reply. 
I only looked through the release notes and changelog of 4.6.4 and the bug reports. 

And thanks for the PPA, I will keep it in mind, but for this time I think i’ll stick with my version since the new LTS comes out next month anyways. 

Christoph