优化读取脚本
This commit is contained in:
+1
-1
@@ -90,7 +90,7 @@ class AddressStandard {
|
||||
}
|
||||
}
|
||||
}
|
||||
},0)
|
||||
},0, "Sheet1")
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ public class ExcelUtils{
|
||||
FileInputStream inp = null;
|
||||
try {
|
||||
inp = new FileInputStream(file);
|
||||
Workbook workbook = WorkbookFactory.create(inp)
|
||||
BufferedInputStream bufferedInputStream = new BufferedInputStream(inp, 1024 * 50)
|
||||
Workbook workbook = WorkbookFactory.create(bufferedInputStream)
|
||||
workbook.setForceFormulaRecalculation(true)
|
||||
Sheet sheet = workbook.getSheetAt(sheetIndex);
|
||||
//行号
|
||||
@@ -82,6 +83,9 @@ public class ExcelUtils{
|
||||
}
|
||||
}
|
||||
ret.add(rowData);
|
||||
if (ret.size() % 10000 == 0) {
|
||||
println(ret.size())
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user