I should have added:

withIgnoreSurroundingSpaces() affects parsing
withTrim() affects printing.

On Fri, 14 Jun 2019 at 15:05, sebb <[email protected]> wrote:
>
> Try using:
>
> withIgnoreSurroundingSpaces()
>
> On Fri, 14 Jun 2019 at 14:03, sebb <[email protected]> wrote:
> >
> > On Fri, 14 Jun 2019 at 13:34, Daryl Stultz <[email protected]> 
> > wrote:
> > >
> > > I'm trying to replace an old CSV library with commons-csv. I seem to be 
> > > having trouble with the most basic idea of the parser recognizing content 
> > > that is quoted.
> > >
> > > I've discovered this bug here:
> > > https://issues.apache.org/jira/browse/CSV-228
> > >
> > > <https://issues.apache.org/jira/browse/CSV-228>The issue refers to the 
> > > parsing of the header, but it doesn't seem to matter what row the 
> > > comma-quoting is on.
> >
> > According to my reading of RFC4180[1], the fields between delimiters
> > are either either escaped or non-escaped.
> > non-escaped fields can include spaces, but not comma
> > escaped fields must start with the double-quote; leading spaces are
> > not permitted.
> >
> > [1] https://tools.ietf.org/html/rfc4180
> >
> > > There's no way I can use this product with this defect. That's 
> > > unfortunate, I like the API and OpenCSV quotes every bit of content when 
> > > printing which I don't like.
> >
> > Now that is the case for DEFAULT and RFC4180.
> >
> > I've not looked into the withTrim() option.
> > If that is supposed to trim before handling quoted fields, then I
> > agree that there seems to be a bug here.
> > But if the trim is only supposed to apply to the un-quoted field, then
> > the current behaviour seems OK, even if it's not what you expect.
> >
> > > --
> > >
> > > Daryl Stultz
> > > Principal Software Developer
> > > _____________________________________
> > > OpenTempo, Inc
> > > http://www.opentempo.com<http://www.opentempo.com/>
> > > mailto:[email protected]<mailto:[email protected]>
> > >

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to