Bug 391770 - CSV importer ignores last line if not followed by a newline
Summary: CSV importer ignores last line if not followed by a newline
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: importer (show other bugs)
Version: git (master)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-12 17:56 UTC by Luca Weiss
Modified: 2018-03-12 18:29 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.0.1
Sentry Crash Report:


Attachments
example csv without a trailing newline (98 bytes, text/csv)
2018-03-12 17:56 UTC, Luca Weiss
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Weiss 2018-03-12 17:56:20 UTC
Created attachment 111345 [details]
example csv without a trailing newline

When the csv file to be imported doesn't have a trailing newline, it ignored the last line i.e. it doesn't get imported.
Attached is an example file.
Comment 1 Thomas Baumgart 2018-03-12 18:29:20 UTC
Git commit 632a4aa42a3c91e05ea14e0278de3dba31bcfd10 by Thomas Baumgart.
Committed on 12/03/2018 at 18:28.
Pushed by tbaumgart into branch '5.0'.

Deal with missing terminal newline in CSV importer

In case the last line of a CSV file does not contain a terminating
newline, the content of that line was discarded. This change takes care
of this situation and adds the line as if a newline was present.
FIXED-IN: 5.0.1

M  +6    -0    kmymoney/plugins/csv/import/core/csvutil.cpp

https://commits.kde.org/kmymoney/632a4aa42a3c91e05ea14e0278de3dba31bcfd10