From 565b575b6aea7758a663218029da35d310bd5634 Mon Sep 17 00:00:00 2001 From: Kane Wang Date: Mon, 11 Aug 2025 12:11:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=BF=9B=E5=BA=A6=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/east-datafile-utils/.vscode/launch.json | 30 +++++++++++++++++++ .../xim/east/utils/DataFileConverter.java | 16 +++++----- 2 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 code/east-datafile-utils/.vscode/launch.json diff --git a/code/east-datafile-utils/.vscode/launch.json b/code/east-datafile-utils/.vscode/launch.json new file mode 100644 index 0000000..b86cf58 --- /dev/null +++ b/code/east-datafile-utils/.vscode/launch.json @@ -0,0 +1,30 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + + { + "type": "java", + "name": "Current File", + "request": "launch", + "mainClass": "${file}" + }, + { + "type": "java", + "name": "App", + "request": "launch", + "mainClass": "com.cpic.xim.App", + "projectName": "east-utils" + }, + { + "type": "java", + "name": "Debug", + "request": "launch", + "mainClass": "com.cpic.xim.App", + "projectName": "east-utils", + "args": ["-Xms512m", "-Xmx8g"] + } + ] +} diff --git a/code/east-datafile-utils/src/main/java/com/cpic/xim/east/utils/DataFileConverter.java b/code/east-datafile-utils/src/main/java/com/cpic/xim/east/utils/DataFileConverter.java index 6a35d83..1f66de8 100644 --- a/code/east-datafile-utils/src/main/java/com/cpic/xim/east/utils/DataFileConverter.java +++ b/code/east-datafile-utils/src/main/java/com/cpic/xim/east/utils/DataFileConverter.java @@ -2,7 +2,7 @@ * @Author: Kane Wang * @Date: 2025-08-09 01:09:26 * @LastEditors: Kane Wang - * @LastModified: 2025-08-09 12:07:23 + * @LastModified: 2025-08-11 11:15:35 * @FilePath: src/main/java/com/cpic/xim/east/utils/DataFileConverter.java * @Description: * @@ -19,7 +19,7 @@ import java.io.IOException; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,9 +35,11 @@ public class DataFileConverter * @throws FileNotFoundException * @throws IOException */ - public static void convertEASTDataFileToXLSX( String eastDataFilePath, - String xlsxFilePath, - String spliterString + public static void convertEASTDataFileToXLSX( + String eastDataFilePath, + String xlsxFilePath, + String spliterString, + String sheetName ) throws FileNotFoundException, IOException @@ -63,8 +65,8 @@ public class DataFileConverter try { - workbook = new XSSFWorkbook(); - sheet = workbook.createSheet( "sheet1" ); + workbook = new SXSSFWorkbook(); + sheet = workbook.createSheet( sheetName ); while ( (line = reader.readLine()) != null ) {