Description
Behaviour:
Whenever the last non-empty line of the CSV file starts with a comment, the CSVParser loops infinitely!
Examplary CSV file:
some # comment OK line # comment OK value # problematic comment
Excerpt of Java code:
private static final char COMMENT = '#'; private static final char QUOTE = '"'; private static final char SEPARATOR = ';'; CSVStrategy csvStrategy = new CSVStrategy(SEPARATOR, QUOTE, COMMENT); CSVParser parser = new CSVParser(reader, csvStrategy); String[] line = parser.getLine(); while (line != null) { Log.debug("Line: " + line[0]); // Do something line = parser.getLine(); }
Used Maven Dependency:
<dependency> <groupId>org.apache.solr</groupId> <artifactId>solr-commons-csv</artifactId> <version>1.4.0</version> </dependency>
Attachments
Issue Links
- duplicates
-
CSV-36 Endless loops in CSV parser
- Closed