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

exception when the csv contains an empty line #29

Closed
mrdfuse opened this issue Oct 23, 2014 · 4 comments
Closed

exception when the csv contains an empty line #29

mrdfuse opened this issue Oct 23, 2014 · 4 comments

Comments

@mrdfuse
Copy link

mrdfuse commented Oct 23, 2014

When the CSV file contains an empty line between some lines, the following exception is thrown:
java.lang.ArrayIndexOutOfBoundsException: 1
at com.xlson.groovycsv.PropertyMapper$_toString_closure1.doCall(PropertyMapper.groovy:67)
at com.xlson.groovycsv.PropertyMapper.toString(PropertyMapper.groovy:67)
at ConsoleScript1.run(ConsoleScript1:7)

@xlson
Copy link
Owner

xlson commented Feb 26, 2015

It'd probably be a good idea to throw a nicer exception in cases like these. When it comes to the actual problem I'd suggest stripping empty lines out of the file first. As I see it it's an error in the data and not in the parsing.

@mrdfuse
Copy link
Author

mrdfuse commented Feb 26, 2015

While there is no real standard for CSV, and https://tools.ietf.org/html/rfc4180 doesn't mention anything about blank lines, most if not all parsers handle it quietly (and not as EOF).
Doesn't matter to me, I can't even remember in what context I encountered this bug :)

@xlson
Copy link
Owner

xlson commented Feb 26, 2015

I know how that feels :) We'll see, perhaps I'll put something in there to handle it anyway. Can't really see a cost. Oh, and thanks for the issue, always much appreciated.

@mrdfuse
Copy link
Author

mrdfuse commented Feb 27, 2015

Yeah no problem, logging them is easy, it's the solving that requires the effort :)

@xlson xlson closed this as completed in 0617b4b Mar 15, 2017
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

No branches or pull requests

2 participants