java 扫描csv


<!--读取csv-->
<dependency>
<groupId>net.sourceforge.javacsv</groupId>
<artifactId>javacsv</artifactId>
<version>2.0</version>
</dependency>





/* @PostMapping("/aa")
public String read(){
String filePath = "D:/case1_feature_relation.csv";
try {
// 创建CSV读对象
CsvReader csvReader = new CsvReader(filePath);
// 读表头
csvReader.readHeaders();
while (csvReader.readRecord()){
// 读一整行
System.out.println(csvReader.getRawRecord());
// 读这行的某一列
// System.out.println(csvReader.get("FILENAME"));
}
} catch (IOException e) {
e.printStackTrace();
}
return "aa";
}*/
posted @ 2018-12-17 12:01  一杯清茶一本书  阅读(127)  评论(0编辑  收藏  举报