Merge pull request #4687 from dataease/pr@dev@pages

fix: 精简模式下导入csv部分文件报错
This commit is contained in:
taojinlong 2023-03-02 16:38:37 +08:00 committed by GitHub
commit 7f79f2e62a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -757,7 +757,13 @@ public class ExtractDataService {
List<List<String>> csvData = new ArrayList<>();
String line;
while ((line = reader.readLine()) != null) {
csvData.add(Arrays.asList(line.split(",")));
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);