Skip to content
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 Parser should ignore blank lines at end of file #268

Open
mogoodrich opened this issue Jun 6, 2024 · 2 comments
Open

CSV Parser should ignore blank lines at end of file #268

mogoodrich opened this issue Jun 6, 2024 · 2 comments

Comments

@mogoodrich
Copy link
Contributor

Minor annoyance/feature request, but if you have blank lines at the end of a csv file, the parser throws an exception saying it it unable to parse those lines. It would be nice if the the parser could just ignore those lines without errorring.

@Ruhanga @mseaton @rbuisson

@mks-d
Copy link
Member

mks-d commented Jul 2, 2024

Something like this could be done after this block.

Or we could perhaps overload CSVReader#readNext().


I'm not sure anymore why things are how they are now, but it might have been more or less intentional actually, in order to detect blank lines here and there (including within the pack, not just at the end of the file) and encourage implementers to keep their CSV clean and tidy. Happy to change this though.

@mseaton
Copy link
Collaborator

mseaton commented Jul 2, 2024

We are already trimming and checking for empty values for each cell entry here. We could just retain a boolean indicating if any non-empty values were found for a row, and if not, return null.

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

No branches or pull requests

3 participants