These are chat archives for nrinaudo/kantan.csv

16th
May 2017
Andrew Roberts
@aroberts
May 16 2017 17:25
hey @nrinaudo quick question- when encoding to csv, is there a way to configure the CSVConfiguration instance to quote every field?
Nicolas Rinaudo
@nrinaudo
May 16 2017 17:32
Not yet - it'll only quote when necessary at the moment. What's your use case?
Nicolas Rinaudo
@nrinaudo
May 16 2017 17:46
One of the things I was about to start was making CsvConfiguration more useful, so if you've got specific requirements, now is a pretty good time to bring them up. Feel free to open issues
Andrew Roberts
@aroberts
May 16 2017 17:54
my use case is matching input csv to output csv (a soft requirement)
if I can get around the quoting, then I don’t have to preserve the input on ingest
I’ll make a ticket
Nicolas Rinaudo
@nrinaudo
May 16 2017 17:55
This sounds easy enough, although potentially not supported by all engines
Andrew Roberts
@aroberts
May 16 2017 17:56
oh, interesting
I’m just in the default engine, my use case isn’t parse-bound enough to merit exploring the others
Nicolas Rinaudo
@nrinaudo
May 16 2017 17:56
Well I don't know, but maybe apache commons or jackson don't support it out of the box
Create the ticket, I'll look into it quickly, seems simple enough
(Famous last words)
Andrew Roberts
@aroberts
May 16 2017 17:58
haha
hopefully this one’s a little softer than the serialization :) thanks!
#85
Nicolas Rinaudo
@nrinaudo
May 16 2017 19:36
so, the bad news is that at least the jackson engine cannot support this
so if I were to add this feature, it wouldn't be coherent accross engines
Andrew Roberts
@aroberts
May 16 2017 20:04
ah, that’s annoying
it’s not a requirement for me, I can work around it
and I definitely understand wanting to keep a consistent interface across implementations
Nicolas Rinaudo
@nrinaudo
May 16 2017 20:05
I can probably work around it, to be honest
and I have encountered tools that needed every single field quoted
Andrew Roberts
@aroberts
May 16 2017 20:05
unless you go the path of having a least-common-denominator CsvConfiguration, and then engine-specific subtypes with additional fields
ah, that’s good to know
Nicolas Rinaudo
@nrinaudo
May 16 2017 20:37
Alright, so it's perfectly possible to support this across all engines, it's just that jackson makes it painful. It'll take a bit of time for me to work out exactly how to do it in a safe way (damn you, mutable global configuration objects)
The tests are going to be fun to write, too...
I also intend to add support for specifying a line separator when writing - I'm currently forcing \r\n as per RFC, but some tools expect \n
Andrew Roberts
@aroberts
May 16 2017 20:54
Man
i don’t envy you this library
supporting the csv spec sounds pretty painful
thanks for tackling this!
Nicolas Rinaudo
@nrinaudo
May 16 2017 20:55
it's purely selfish, I have to deal with tons of CSV at work
at least this way the actual code that makes it to production is readable and mostly CSV free