From 78c1c5259c650783a4941a41098c0f5c84fd0551 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Thu, 2 Mar 2023 16:37:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=B2=BE=E7=AE=80=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=B8=8B=E5=AF=BC=E5=85=A5csv=E9=83=A8=E5=88=86=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/service/dataset/ExtractDataService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java b/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java index a128f5627e..35651738da 100644 --- a/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java +++ b/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java @@ -757,7 +757,13 @@ public class ExtractDataService { List> csvData = new ArrayList<>(); String line; while ((line = reader.readLine()) != null) { - csvData.add(Arrays.asList(line.split(","))); + if(line.endsWith(",")){ + List 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);