读取CSV文件
/**
* 读取 CSV 文件
*
* @return
*/
public static LinkedList readCSV(String path) {
LinkedList list = new LinkedList<>();
BufferedReader reader = null;
try {
FileInputStream fis = new FileInputStream(path);
InputStreamReader isr = new InputStreamReader(fis, "GBK");
reader = new BufferedReader(isr);
String line;
while ((line = reader.readLine()) != null) {
String[] rows = line.split(",");
CsvData info = new CsvData();
info.setColumn1(rows.length > 0 ? rows[0] : null);
info.setColumn2(rows.length > 1 ? rows[1] : null);
info.setColumn3(rows.length > 2 ? rows[2] : null);
info.setColumn4(rows.length > 3 ? rows[3] : null);
info.setColumn5(rows.length > 4 ? rows[4] : nul