Closed mrdfuse closed 7 years ago
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). Doesn't matter to me, I can't even remember in what context I encountered this bug :)
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)