GNOME Bugzilla – Bug 760617
Reduce the import options for invoices as CSV.
Last modified: 2018-06-29 23:46:23 UTC
Currently there are 5 file-type import options for invoices and bills. I propose: 1. Getting rid of the custom regex option, as I don't believe anyone will ever use it. 2. Since the (with quotes) regexes now accept a more flexible field format the without quotes options are no longer needed so get rid of the less flexible options. This will just leave either comma or semi-colon options. 3. Possibly add a tab delimited option.
No strong opinion on 1. I don't agree with 2. however: I don't think with and without quotes options are equivalent and their choice depends on the input format of the user. For example if you have a notes field like this ;Something called "Bla"; This can be imported with the without-quotes regex, but not with the with-quotes regex. For the latter you'd need ;"Something called ""Bla"""; Option 3 would be a nice improvement.
According to https://tools.ietf.org/html/rfc4180 point 2.5 5. Each field may or may not be enclosed in double quotes (however some programs, such as Microsoft Excel, do not use double quotes at all). If fields are not enclosed with double quotes, then double quotes may not appear inside the fields. For example: "aaa","bbb","ccc" CRLF zzz,yyy,xxx
My apologies I didn't reply any more Mike. I apparently forgot about it. Post-mortem, here's what I wanted to add in reply: your reference indeed shows that proper csv can't have the example I gave. On the other hand there are lots of dialects of csv. Forcing our users to pre-process their data to make it comply with the strict standard would be unfortunate if we can relatively easily offer more than one option to parse. As a side note I'll add that I'm currently reworking our plain csv importer in c++. I may run into similar issues regarding quotes or not. I may change my mind if it would turn out to be too complicated to support both in the new code ;)
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=760617. Please update any external references or bookmarks.