Escaping double quotes in csv import (without transforming the file)

When using the 'CSV' module to import large csv files, a comma is used as separator and a tilde (~) as quote character. Somehow the 'importCSV' java action also uses the default double quotation mark as quote character (although the tilde has already been specified as quote character), leading to errors when importing csv files with double quotation marks. Is anyone familiar with this module and behavior, and knows how to escape the double quotes? When importing an csv file with an uneven amount of double quotations marks I get the following error: "com.mendix.core.CoreException: com.mendix.modules.microflowengine.MicroflowException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: Unterminated quoted field at end of CSV line. Beginning of lost text: [~20646  6000  MILL  2"OD 1.5  ~,ET-UPC0461,SF_EXT0012000000CvhC0AAJ,2019-10-10,Movex~33...]" The csv file in retrieved from a server and imported automatically, so replacing/transforming the double quotation marks won't work, unless this can be done automatically as well (in a Java action for instance).
2 answers

Hi Dave,

I can import the data you shared. This is what I did.

Hope it helps,



~3385140~,~TIB~,~10~,~2019-10-09~,~158.00000~,~Shipped~,~ETUP1096501006 ~,~20646 6000 MILL 2"OD 1.5 ~,~ET-UPC0461~,~SF_EXT0012000000CvhC0AAJ~,~2019-10-10~,~Movex~
~3385434~,~TIB~,~10~,~2019-10-08~,~240.00000~,~Shipped~,~ETUP0595201015 ~,~CT7/6.4M Curtain Track, 2-3635~,~ET-UPC0197~,~SF_EXT0012000000Cvh8KAAR~,~2019-10-08~,~Movex~
~3383947~,~TIB~,~40~,~2019-09-24~,~532.00000~,~Shipped~,~ETUP3678901002 ~,~Stile 84x25x2.05/1.45 3330mm ~,~ET-UPC1347~,~SF_EXT0012000000Cvh87AAB~,~2019-09-26~,~Movex~
~3377510~,~TIB~,~60~,~2019-09-27~,~267.00000~,~Shipped~,~ETUP3383403002 ~,~204093 BGE9001 3800 ~,~ET-UPC3233~,~SF_EXT001D000000nGGU5IAO~,~2019-09-19~,~Movex~
~3385627~,~TIB~,~20~,~2019-10-16~,~270.00000~,~Shipped~,~ETUP0008601005 ~,~3200MM 4-0009 ~,~ET-UPC0210~,~SF_EXT0012000000HwpjPAAR~,~2019-10-15~,~Movex~
~3386658~,~TIB~,~10~,~2019-10-21~,~1465.00000~,~Shipped~,~ETUP4231001001 ~,~1255 5101MM 214163 ~,~ET-UPC3972~,~SF_EXT00157000024fj7fAAA~,~2019-10-22~,~Movex~


Hello Dave,

Have you tried the flat file importer module?

I’m not familiar with the CSV module, but the flat file one might be a suitable replacement.

Hope this helps.