Skip to content

Commit 67390ea

Browse files
committed
Handle CommentStart option
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1306345 13f79535-47bb-0310-9956-ffa450edef68
1 parent fcfb6dc commit 67390ea

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/test/java/org/apache/commons/csv/CSVFileParserTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ public void testCSVFile() throws Exception {
9696
fmt = fmt.withEmptyLinesIgnored(Boolean.parseBoolean(option_parts[1]));
9797
} else if ("IgnoreSpaces".equalsIgnoreCase(option_parts[0])) {
9898
fmt = fmt.withSurroundingSpacesIgnored(Boolean.parseBoolean(option_parts[1]));
99+
} else if ("CommentStart".equalsIgnoreCase(option_parts[0])) {
100+
fmt = fmt.withCommentStart(option_parts[1].charAt(0));
99101
} else {
100102
fail(testName+" unexpected option: "+option);
101103
}

src/test/resources/CSVFileParser/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ The first line of this file consists of several space-separated fields:
1111
- (optional) settings to be applied to the default parsing format, which is delim=',' encap='"'
1212
The settings have the form (see test source file for full details):
1313
IgnoreEmpty=true|false
14+
IgnoreSpaces=true|false
15+
CommentStart=char
1416

1517
The second line is the expected output from invoking CSVFormat#toString() on the parsing format
1618

0 commit comments

Comments
 (0)