csv-commons - withSkipHeaderRecord 选项不会跳过任何内容

gst*_*low 3 java csv parsing header apache-commons-csv

我有通常的带标题的 csv 文件

f1, f2, f3
1, 2, 3
Run Code Online (Sandbox Code Playgroud)

我尝试解析它:

 Iterable<CSVRecord> records = CSVFormat.EXCEL.withIgnoreEmptyLines().withSkipHeaderRecord().parse(in);
            records.forEach(record -> {
               ...
Run Code Online (Sandbox Code Playgroud)

但无论如何,第一条记录无论如何都是标题。

我有什么错吗?

SVK*_*ETO 6

specify that file have header to skip:

CSVFormat.EXCEL.withHeader().withSkipHeaderRecord();
Run Code Online (Sandbox Code Playgroud)