【发布时间】:2015-11-28 14:09:28
【问题描述】:
如何使用apache commons csv 跳过输入文件中的行。在我的文件中,前几行是 garbage 有用的元信息,如日期等。找不到任何选项。
private void parse() throws Exception {
Iterable<CSVRecord> records = CSVFormat.EXCEL
.withQuote('"').withDelimiter(';').parse(new FileReader("example.csv"));
for (CSVRecord csvRecord : records) {
//do something
}
}
【问题讨论】: