Tyler King created CSV-265:
------------------------------
Summary: CSV comments break CSVRecord#getCharacterPosition
Key: CSV-265
URL: https://issues.apache.org/jira/browse/CSV-265
Project: Commons CSV
Issue Type: Bug
Components: Parser
Affects Versions: 1.8
Reporter: Tyler King
The CSV#getCharacterPosition method returns an incorrect value after the
CSVParser has encountered a comment in the CSV files.
Example:
{code:java}
String csv = "Header1,Header2\n"
+ "# Comment\n"
+ "Value1,Value2\n";
CSVFormat format =
CSVFormat.EXCEL.withCommentMarker('#').withFirstRecordAsHeader();
CSVParser parser = new CSVParser(new StringReader(csv), format);
long expectedPosition = csv.indexOf("Value1");
long actualPosition = parser.iterator().next().getCharacterPosition();
assertEquals(expectedPosition, actualPosition);{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)