From 7bf41ec2497e0276f1c8f536175428329b8c55e8 Mon Sep 17 00:00:00 2001 From: Sankakumaru Date: Thu, 29 Nov 2018 23:29:51 +0900 Subject: [PATCH] =?UTF-8?q?=E5=A0=B1=E5=91=8A=E6=9B=B8(=EF=BC=93=E7=A8=AE?= =?UTF-8?q?=E9=A1=9E)=E3=81=A8=E8=B3=87=E6=BA=90=E3=83=81=E3=83=A3?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=8C=E6=AD=A3=E5=B8=B8=E3=81=AB=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E4=B8=8D=E5=85=B7?= =?UTF-8?q?=E5=90=88=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/logbook/dto/chart/ResourceLog.java | 9 +++++++-- main/logbook/gui/logic/CreateReportLogic.java | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/main/logbook/dto/chart/ResourceLog.java b/main/logbook/dto/chart/ResourceLog.java index 718f9e28..c67ee675 100644 --- a/main/logbook/dto/chart/ResourceLog.java +++ b/main/logbook/dto/chart/ResourceLog.java @@ -71,8 +71,13 @@ public static ResourceLog getInstance(File file) throws IOException { while (ite.hasNext()) { String line = ite.next(); // 日付,(直前のイベント,)燃料,弾薬,鋼材,ボーキ,高速建造材,高速修復材,開発資材,ネジ - // 高速建造材,高速修復材が逆になっているので注意 - String[] colums = line.split(","); + // 高速建造材,高速修復材が逆になっているので注意 + String[] colums; + if (line.contains(",")) { + colums = line.split(","); + } else { + colums = line.split("\t"); + } try { pos.setIndex(0); Date date = null; diff --git a/main/logbook/gui/logic/CreateReportLogic.java b/main/logbook/gui/logic/CreateReportLogic.java index ed94c02c..f3555320 100644 --- a/main/logbook/gui/logic/CreateReportLogic.java +++ b/main/logbook/gui/logic/CreateReportLogic.java @@ -864,7 +864,7 @@ public static List loadCreateShipReport() { File file = new File(FilenameUtils.concat(AppConfig.get().getReportPath(), AppConstants.LOG_CREATE_SHIP)); if (file.exists()) { CSVReader reader = new CSVReader(new InputStreamReader( - new FileInputStream(file), AppConstants.CHARSET)); + new FileInputStream(file), AppConstants.CHARSET), '\t'); dtoList = getCreateShip(reader.readAll()); reader.close(); } @@ -904,7 +904,7 @@ public static List loadCreateItemReport() { File file = new File(FilenameUtils.concat(AppConfig.get().getReportPath(), AppConstants.LOG_CREATE_ITEM)); if (file.exists()) { CSVReader reader = new CSVReader(new InputStreamReader( - new FileInputStream(file), AppConstants.CHARSET)); + new FileInputStream(file), AppConstants.CHARSET), '\t'); dtoList = getCreateItem(reader.readAll()); reader.close(); } @@ -944,7 +944,7 @@ public static List loadMissionReport() { File file = new File(FilenameUtils.concat(AppConfig.get().getReportPath(), AppConstants.LOG_MISSION)); if (file.exists()) { CSVReader reader = new CSVReader(new InputStreamReader( - new FileInputStream(file), AppConstants.CHARSET)); + new FileInputStream(file), AppConstants.CHARSET), '\t'); dtoList = getMissionResult(reader.readAll()); reader.close(); }