fix: 精简模式下导入csv部分文件报错

This commit is contained in:
taojinlong 2023-03-02 16:37:04 +08:00
parent fc78ac790e
commit 78c1c5259c

View File

@ -757,8 +757,14 @@ public class ExtractDataService {
List<List<String>> csvData = new ArrayList<>();
String line;
while ((line = reader.readLine()) != null) {
if(line.endsWith(",")){
List<String> list = new ArrayList<>(Arrays.asList(line.split(",")));
list.add("");
csvData.add(list);
}else {
csvData.add(Arrays.asList(line.split(",")));
}
}
ExcelSheetData csvSheetData = new ExcelSheetData();
String[] fieldArray = fields.stream().map(TableField::getFieldName).toArray(String[]::new);
csvSheetData.setFields(fields);