📜  读取 csv java android - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:21.144000             🧑  作者: Mango

代码示例1
import com.opencsv.CSVReader;
import java.io.IOException;
import java.io.FileReader;


...

try {
    CSVReader reader = new CSVReader(new FileReader("yourfile.csv"));
    String[] nextLine;
    while ((nextLine = reader.readNext()) != null) {
        // nextLine[] is an array of values from the line
        System.out.println(nextLine[0] + nextLine[1] + "etc...");
    }
} catch (IOException e) {

}