Search code examples
node.jscsvparsingamazon-redshiftnode-csv-parse

CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE csv parse for node?


I'm using a 3rd party application that throws this error:

Error: Invalid Closing Quote: found non trimable byte after quote at line 5
code:                 CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE
column:               16
empty_lines:          0
header:               false
index:                16
invalid_field_length: 0
quoting:              true
lines:                5
records:              4

when loading a csv file (I have to use this application). I think this application is using this node service: https://csv.js.org/parse/errors/

I also think the trouble is that column 16 has fields that look like this:

\Circular Logic 3\""

But I don't quite understand the issue.

Can anyone tell me if this column is not escaping the quotes properly? I have a ton of files and many instances like this in column 16 so it would be a pain to fix this manually.


Solution

  • It looks like proper escaping for double quotes in csv is another double quote. So the line should be:

    \Circular Logic 3"""
    

    We'll have to reformat the data.