How to get ReadNextLine in CSV Module to work with content containing commas while using pipe delimiter

1
I am using the latest version of the CSV module from the Marketplace. I have set the delimiter as '|' a pipe delimiter. When I import a file with the content as in the image below, I discovered that the first row after the header gets read correctly and mapped to the appropriate columns in the import entity. However, the second row after the header gets read into the first column in its entirety. When I delete the commas in the Description the second row of data, the import of that row works correctly. Is this a bug and is there a way to get around this issue and ensure that rows with commas are read correctly?  
asked
1 answers
0

After further investigation, I discovered the issue: it appears that when ReadNextLine sees the commas in the description, it puts quotes (") at the start and at the end of the string. Thus, because I had set " as the Quote character the entire string was being treated as a single value and being read into the first column. To fix this, I set the Quote character to empty and then used a replaceAll() to replace the " with a space character (which I remove with a trim()). 

 

It's kind of weird that the " are being appended to the row values...maybe that's a bug?

answered