Bug 437810 - CSV importer should trim the column contents before importing
Summary: CSV importer should trim the column contents before importing
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: importer (show other bugs)
Version: 5.1.1
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-29 03:25 UTC by Dawid Wróbel
Modified: 2021-05-29 03:44 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.1.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dawid Wróbel 2021-05-29 03:25:44 UTC
SUMMARY
When importing my brokerage account's transaction history, I did not notice that the SYMBOL column contents were prefixed with a whitespace. When importing such file, the importer correctly (i.e. sans prepending whitespace) created all of the previously missing securities. However, after continuing with the importing of actual transactions, it failed to match the non-trimmed symbol with the previously created trimmed securities. 


STEPS TO REPRODUCE
1. Attempt to import a CSV with symbols having a space in front of them

OBSERVED RESULT
The securities are created as expected with the space trimmed, but the import itself fails with "This imported statement contains investment transactions with no security.  These transactions will be ignored."

EXPECTED RESULT
The whitespace should be trimmed from all of the cells and the transactions should import properly
Comment 1 Dawid Wróbel 2021-05-29 03:40:23 UTC
Git commit ad144629b6ea089e7152ef8a32c18d9a025c938b by Dawid Wróbel.
Committed on 29/05/2021 at 03:38.
Pushed by wrobelda into branch '5.1'.

Trim whitespace from cells when importing a CSV
FIXED-IN: 5.1.2

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

https://invent.kde.org/office/kmymoney/commit/ad144629b6ea089e7152ef8a32c18d9a025c938b
Comment 2 Dawid Wróbel 2021-05-29 03:44:44 UTC
Git commit 441cb82560b17f71127befd7d02c328eb6930483 by Dawid Wrobel, on behalf of Dawid Wróbel.
Committed on 29/05/2021 at 03:44.
Pushed by wrobelda into branch 'master'.

Trim whitespace from cells when importing a CSV
FIXED-IN: 5.1.2


(cherry picked from commit ad144629b6ea089e7152ef8a32c18d9a025c938b)

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

https://invent.kde.org/office/kmymoney/commit/441cb82560b17f71127befd7d02c328eb6930483