Is there a way not to escape with \ in a csv feeder?


My csv contains a json and is strictly compliant with the RFC. So the json is escaping with a backslash my double-quotes.

CSV should escape double-quotes by doubling them.

But since the backslash is seen as an escape character, it’s getting removed and I don’t want that.

Exemple of a csv line:


and what I would expect to receive for the second field:


but I get:


I can I solve that?


Sad thing.
I missed that the backslash escaping wasn’t part of RFC4180, so I hardcoded it when I switched from opencsv to Jackson:

Currently, you’d either have to fork the feeder, or use rawSplit, and then convert the column to remove the outer double quotes. See Feeder doc:

Yes. I was getting there when reading the code.

But rawSplit will then separate the commas in my json if I’m not mistaken. So I will need to stitch my field back to sanity.

Right now, I’m looking for implementing my own stream function as in SeparatedValuesParser. But I first need to find out a working CSVParser configuration.

Ok, using this does work:

CSVParser parser = new CSVParser(’,’, ‘"’, ‘\0’);

I can provide a patch when I have 2 minutes but how would you solve it? Set this by default to respect the RFC? Add a new method in FeederSupport that takes an escapeChar? Both?


CSVParser is from opencsv and is getting out.
Please target master, ie 2.2.

  • Add a new Option[Char] parameter to SeparatedValuesParser methods.

  • Add new parameters to FeederSupport.separatedValues

  • Update Feeder doc

Thanks :slight_smile: