Bug 348635

Summary: CSV Importer can create Payee consisting of a single or multiple space leading to erronous matching
Product: [Applications] kmymoney Reporter: rob.vdm.82
Component: importerAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal CC: agander93, ralf.habacker
Priority: NOR    
Version: 4.7.2   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 4.8.0
Attachments: Sample import CSV
Patch to fix problem.

Description rob.vdm.82 2015-06-03 13:09:22 UTC
My bank issued CSV files have a  few Payee entries that contained a single space. This created a Payee entry in kmymoney called " " and started matching all subsequent Payto entries with a space somewhere in the name. 

Once I corrected my CSV and deleted the " " payee, import went as expected.

It would suggest to change Kmymoney and add some protection for this type of matching, like ignoring 1 character matches, or changing the csv importer code reformat " " to a truly empty field, or throw an error.

Reproducible: Always

Steps to Reproduce:
1. Import example CSV
2. Watch as it matches all payees to a single space

Actual Results:  
All blank payees

Expected Results:  
Not match nor create a single space payee
Comment 1 rob.vdm.82 2015-06-03 13:10:19 UTC
Created attachment 92973 [details]
Sample import CSV
Comment 2 allan 2015-06-03 13:32:14 UTC
This is confirmed.  I've produced a patch on the lines of your second suggestion.  I need to do some more testing, however.
Comment 3 allan 2015-06-04 13:43:12 UTC
Created attachment 92993 [details]
Patch to fix problem.

I'll leave the patch here for a few days, before committing.
Comment 4 allan 2015-06-11 21:35:47 UTC
Git commit e5cc53e369b6ec9bc0e7ae2a7a5662b417d190ed by Allan Anderson.
Committed on 11/06/2015 at 21:34.
Pushed by allananderson into branch 'master'.
Fix CSV Importer allowing creation of Payee consisting of a single or multiple spaces leading to erroneous
matching.

M  +7    -2    kmymoney/plugins/csvimport/csvdialog.cpp

http://commits.kde.org/kmymoney/e5cc53e369b6ec9bc0e7ae2a7a5662b417d190ed