如何使用openCSV获取和显示csv的一些行。我目前有以下代码:
CSVReader reader1 = new CSVReader(new FileReader(mydata_csv.getpath()));
List myDatas = reader1.readAll();如何显示某一特定行?
也许我可以使用一种更好的方法来存储我的数据( csv包含数百行变量)。任何建议都是受欢迎的。
发布于 2013-08-30 16:32:28
您应该使用以下代码:
CSVReader reader = new CSVReader(new FileReader(mydata_csv.getpath()));
String [] nextLine;
while ((nextLine = reader.readNext()) != null) {
// nextLine[] is an array of values from the line
System.out.println(nextLine[0] + nextLine[1] + "etc...");
}https://stackoverflow.com/questions/7916747
复制相似问题