Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

can quoteChar be disabled? #32

Closed
dirkraft opened this issue Mar 3, 2014 · 1 comment
Closed

can quoteChar be disabled? #32

dirkraft opened this issue Mar 3, 2014 · 1 comment
Milestone

Comments

@dirkraft
Copy link

dirkraft commented Mar 3, 2014

I'm using jackson to convert TSV piped output (from mysql command) to CSV. Right now I have to pick a character that will never happen to avoid the _nextQuotedString processing block , since this output is never quoted. If a cell starts with the quote char, it asplodes.

So I'd rather disable the quote char entirely. This is what I'm currently doing which for my input which effectively disables quoted cells.

mapper.reader(String[].class).with(CsvSchema.emptySchema()
            .withColumnSeparator('\t')
            .withQuoteChar('\0')
)

This works, but is semantically inaccurate (I think?). Would it be possible to disable the quoteChar (and thus quoted cell values) altogether, to prevent any accidental interpretation of ANY character as starting a quoted value?

@cowtowncoder
Copy link
Member

I think this is an oversight: there is already withoutEscapeChar() method in CsvSchema, and I think there should then also be withoutQuoteChar() method. So I will take it as an RFE to do just that.

Since new features can only go in a minor version, this can go in 2.4.0.
In the meantime your approach should be valid, assuming that null byte (char 0) is never used -- and I don't think there are any legal use cases for textual content.
So I think you can use that until 2.4 is ready.

Thank you for reporting this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants