Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Csv commons with IgnoreEmptyLines方法不';没有影响_Java_Csv_Apache Commons Csv - Fatal编程技术网

Java Csv commons with IgnoreEmptyLines方法不';没有影响

Java Csv commons with IgnoreEmptyLines方法不';没有影响,java,csv,apache-commons-csv,Java,Csv,Apache Commons Csv,我编写了以下代码: Iterable<CSVRecord> records = CSVFormat.EXCEL.withIgnoreEmptyLines().withSkipHeaderRecord().parse(in); records.forEach(record -> {... 为什么会这样 如何使其按预期工作 附笔。 withSkipHeaderRecord也不起作用ignoreEmptyLines()只会忽略完全空行,即完全没有字符,不是这里的逗号列表,它不是空行

我编写了以下代码:

Iterable<CSVRecord> records = CSVFormat.EXCEL.withIgnoreEmptyLines().withSkipHeaderRecord().parse(in);
records.forEach(record -> {...
为什么会这样

如何使其按预期工作

附笔。
withSkipHeaderRecord也不起作用

ignoreEmptyLines()只会忽略完全空行,即完全没有字符,不是这里的逗号列表,它不是空行,而是所有值都为空的一行。@centic,如我所述,是忽略行的现成方法吗?@centic,跳过标题行如何?否,我看不到这方面的内置功能,您需要检查并跳过您端的记录。@centic,那么使用KipheaderRecord的方法呢?
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,