0
String csvFilename = "C:\\ClothingItem.csv";
CSVReader csvReader = new CSVReader(new FileReader(csvFilename));
String[] row = null;
while ((row = csvReader.readNext()) != null) {
// Here my objective is to check if row[0] contains some
// string"abc" then
// I want to add the next 15 lines from csv file to a list.
// Then again check the same condition after those lines means
// from the 16th line and than add again to the list.
// How could I approach?
}
我已經在while循環中提到了我的目標。有條件地從csv文件中添加行
你爲什麼不具有可變'當你遇到「ABC」,它遞減,而讀下一行,當計數器命中0,再次檢查「ABC」條件counter'設置爲15。 – Srinivas
@Srinivas聽起來像一個合適的回答對我來說,不只是一個評論:) –
@ user1788115如果你的邏輯你的麻煩提供更多的信息,如果你要處理的CSV文件使用的lib像[HTTP://supercsv.sourceforge。淨/] –