[kmymoney] [Bug 395025] New: csv writer generates invalid file in case field delimiter is used in any field

Ralf Habacker bugzilla_noreply at kde.org
Mon Jun 4 12:25:19 UTC 2018


https://bugs.kde.org/show_bug.cgi?id=395025

            Bug ID: 395025
           Summary: csv writer generates invalid file in case field
                    delimiter is used in any field
           Product: kmymoney
           Version: 4.8.1
          Platform: Other
                OS: MS Windows
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: exporter
          Assignee: kmymoney-devel at kde.org
          Reporter: ralf.habacker at freenet.de
  Target Milestone: ---

While working on bug 328050 it turned out that the csvwriter generates invalid
csv files in case the field separator is used in any field. 

Examples: 
amount fields uses ',' as decimal delimiter and field separator is ','
memo fields contains ',' and field separator is ','
memo fields contains ';' and field separator is ';'

In those cases the related line in the csv file will be parsed by clients as
having additional fields.

Datum,Zahlungsempfänger,Betrag,Konto/Kategorie,Notiz,Status,Nummer
2018-05-11,,-0,10,invest:securities,,,
2018-05-11,,0,00,invest:securities,,,

The decimal delimiter in column "Betrag" adds an additional column to the line

https://en.wikipedia.org/wiki/Comma-separated_values#RFC_4180_standard gives
some hints how to setup csv files

For the amount fields it may help to use '.' as decimal separator and to
disable the thousand separator:

Datum,Zahlungsempfänger,Betrag,Konto/Kategorie,Notiz,Status,Nummer
2018-05-11,,-0.10,invest:securities,,,
2018-05-11,,0.00,invest:securities,,,

or to quote the related values as shown below

Datum,Zahlungsempfänger,Betrag,Konto/Kategorie,Notiz,Status,Nummer
2018-05-11,,"-0,10",invest:securities,,,
2018-05-11,,"0,00",invest:securities,,,

Memo field values need to be quoted to avoid this issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the KMyMoney-devel mailing list