-
Notifications
You must be signed in to change notification settings - Fork 32
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
Comments
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. |
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). |
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. |
Yeah no problem, logging them is easy, it's the solving that requires the effort :) |
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)
The text was updated successfully, but these errors were encountered: