如何从csv文件中获取记录的长度?

时间:2018-07-17 10:33:06

标签: java csv

我正在使用org.apache.commons.csv来读取csv文件。我的代码看起来像这样

Iterable<CSVRecord> records = CSVFormat.RFC4180.withIgnoreEmptyLines(true)
                                               .parse((Reader)arg0.getReader());

for (CSVRecord record : records) {

}

如何从每个record中获取逗号分隔的字符串值?

2 个答案:

答案 0 :(得分:1)

您可以使用 var replyText = " Signal #"+coinName+ " has reached 1st target! " +profit+ "% profit \nCurrent Price:" +liveCoinPrice+ "\nDuration: " +difference + "\nNote: Message from live coin high node server"; size()方法

get(int index)

所有detailled doc is here

答案 1 :(得分:1)

用于(CSVRecord记录:记录){

currentRecordSize = record.size();

//代码

}