Strings in the CSV output produced by Json2Csv.convert are surrounded by triple quotes, which is not standard and not understood by CSV readers I'm using to read the output (e.g. Spark's CSV reader). The result is that all strings end up with the triple quotes included in the values when read.
Here's a simple demonstration:
object Foo extends App {
import com.github.agourlay.json2Csv.Json2Csv
import java.io.ByteArrayOutputStream
val json = """{"a": "abcdefg", "b": "hijklmnop"}"""
val baos = new ByteArrayOutputStream
Json2Csv.convert(Stream(json), baos)
println(baos.toString("UTF8"))
}
Strings in the CSV output produced by
Json2Csv.convert
are surrounded by triple quotes, which is not standard and not understood by CSV readers I'm using to read the output (e.g. Spark's CSV reader). The result is that all strings end up with the triple quotes included in the values when read.Here's a simple demonstration:
The output is: