-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
(csv) Add a CsvParser.Feature.SKIP_EMPTY_LINES
to allow skipping empty rows
#15
Comments
note: Original had 5 thumbs-up, couple of +1s. So highly requested. |
Is anyone working on this? I would be happy to pick it up. |
@kg29 No one is workign on this as far as I know, so help would be highly valued! |
This is the only thing preventing us from switching from commons-csv. |
@kunickiaj One thing that could help (I may have time to look into this after completing non-blocking json parser) would be a failing unit test that simply shows how you'd like this to work. That is, test that would pass after fix. |
Yeah, I may look into this once I get a free moment. We did some benchmarks against jackson csv + guard clause on our side vs commons-csv and it pretty much wiped out any performance gains from moving to jackson. Figure fixing it here should be a much better option. |
Here's a trivial test which would pass given the desired behavior. |
Excellent thank you; I'll have a look. |
CsvSchema
option to allow skipping empty rowsCsvParser.Feature.SKIP_EMPTY_LINES
to allow skipping empty rows
Quick note: I think this makes more sense as |
Hmmh. Looking at code, this may not be easy to implement. As things are, |
For documentation purposes, I'll note that feature itself was actually added in 2.9, but implementation not. This is unfortunate. |
Hi @cowtowncoder how did this go? Has this been implemented? Your last comment was a wee bit confusing. |
@ehills No, functionality has not been added and does not exist. |
Maybe I misunderstand something here, but from the description in the first comment, I think this should be described as "skip blank lines", i.e. lines with only whitespace. Maybe you'd like to add SKIP_BLANK_LINES instead of changing SKIP_EMPTY_LINES to do this, otherwise code which uses the library could change its behaviour when using the new version. Also, in the linked unit test I don't find any blank (only whitespace) lines, just empty lines: Current CSV string: Test for blank line being removed would need something like: The rest of the test would be identical. Cheers, Anders |
Not works for me yet |
Good point on "skip blank" vs "skip empty". |
And there was much rejoining for now @vboulaye's patch is merges into |
Looks like a commonly supported option with CSV (family of formats) is to allow skipping of empty rows; that is, ones that only contain white-space.
The text was updated successfully, but these errors were encountered: