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?
I missed that the backslash escaping wasn’t part of RFC4180, so I hardcoded it when I switched from opencsv to Jackson: https://github.com/gatling/gatling/blob/v2.2.0-M3/gatling-core/src/main/scala/io/gatling/core/feeder/SeparatedValuesParser.scala#L44
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: http://gatling.io/docs/2.1.7/session/feeder.html
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.