Skip to content

PROPOSAL: Lines containing whitespace only should not generate empty records#18

Closed
attil-io wants to merge 4 commits into
apache:masterfrom
attil-io:master
Closed

PROPOSAL: Lines containing whitespace only should not generate empty records#18
attil-io wants to merge 4 commits into
apache:masterfrom
attil-io:master

Conversation

@attil-io

Copy link
Copy Markdown

With the following settings, I would expect that any line containing white space only, does NOT generate an additional empty record:

IgnoreEmpty=true IgnoreSpaces=true

Reason is, that since white spaces (like tab, space) are ignored, then white-space-only line should count as empty lines (and empty lines are ignored too).

Please tell me if you agree with the idea or not (if you do, I will be happy to do all the necessary steps, like creating JIRA account, opening ticket, signing the CLA, etc.)

I'm also aware, that maybe my code change is not the best solution for the problem (e.g. now ignoreWhiteSpaces is checked twice in Lexer.nextToken()), so please treat this PR rather as a POC, and not the final solution. I would be happy to rework it, if you have any suggestions/comments.

@coveralls

coveralls commented Jun 25, 2017

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.2%) to 93.157% when pulling e37be61 on attil-io:master into 0bdca58 on apache:master.

1 similar comment
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.2%) to 93.157% when pulling e37be61 on attil-io:master into 0bdca58 on apache:master.

@garydgregory

Copy link
Copy Markdown
Member

Closing this PR as we have the following:

  • org.apache.commons.csv.CSVFormat.withIgnoreEmptyLines()
  • org.apache.commons.csv.CSVFormat.withIgnoreEmptyLines(boolean)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants