-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added ignoreQuoteInToken support to ignore quotes in strings #46
base: master
Are you sure you want to change the base?
Conversation
…n there are few encapsulatedTokens with comma within
@ranjithrp , |
i have added the junits. |
Would you mind showing an example with actual expected rows please? It is not clear to me yet if this is a good thing. |
In the actual expected row, we have one column which has value with quotes in it, and other column which has a comma in it. Here the second column has value "xyz" 123 bar. This has quotes in the token if i use withQuote(null), it ignores the quote for the fifth column and then splits that value to 2. This was the problem we were facing, and to handle this, i had made the above change. |
@garydgregory Hope the above explanation clarifies your question. Please let me know if you need any additional details. Thanks |
@ranjithrp |
@garydgregory i have tried to do the same in src/test/java/org/apache/commons/csv/LexerTest.java. In one of the test case, i have set the boolean to true and shown how it is able to retrieve each token and have asserted the values also. |
Please document in the PR description the expected column values. It's not clear to me how malformed the input is and what you are exactly trying to work around. Is this really about dealing with malformed input. If the input was properly escaped or formatted, could the input be processed properly? |
added ignoreQuoteInToken support to ignore quotes in strings even when there are few encapsulatedTokens with comma within. This will help in parsing csv values like
abc,"xyz" 123 bar,3,11961034,"First author, Second Author"