|
|
@ -28,16 +28,10 @@ public class A8 {
|
|
|
|
//哪些是处理不了的,就不处理了~
|
|
|
|
//哪些是处理不了的,就不处理了~
|
|
|
|
static String[] excludeCityList = {"~$", "磨憨-磨丁", "经开区", "阳宗海"};
|
|
|
|
static String[] excludeCityList = {"~$", "磨憨-磨丁", "经开区", "阳宗海"};
|
|
|
|
|
|
|
|
|
|
|
|
//有好多EXCEL,啥样的有用?必须带有关键字字样的才有用!
|
|
|
|
|
|
|
|
static String fileNameKey = "人口变化";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) throws IOException, InvalidFormatException, InterruptedException, DocumentException {
|
|
|
|
public static void main(String[] args) throws IOException, InvalidFormatException, InterruptedException, DocumentException {
|
|
|
|
//初始化数据库连接
|
|
|
|
//初始化数据库连接
|
|
|
|
LocalMysqlConnectUtil.Init();
|
|
|
|
LocalMysqlConnectUtil.Init();
|
|
|
|
//实例化
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//结果Excel
|
|
|
|
//结果Excel
|
|
|
|
XSSFWorkbook outWorkbook = new XSSFWorkbook();
|
|
|
|
XSSFWorkbook outWorkbook = new XSSFWorkbook();
|
|
|
|
//结果Sheet
|
|
|
|
//结果Sheet
|
|
|
@ -58,6 +52,10 @@ public class A8 {
|
|
|
|
List<File> files = FileUtil.loopFiles(parentPath, file -> true);
|
|
|
|
List<File> files = FileUtil.loopFiles(parentPath, file -> true);
|
|
|
|
int rowIndex = 0;
|
|
|
|
int rowIndex = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (File file : files) {
|
|
|
|
|
|
|
|
System.out.println("正在处理:" + file.getName());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//处理这个目录
|
|
|
|
//处理这个目录
|
|
|
|
if (files != null) {
|
|
|
|
if (files != null) {
|
|
|
|
for (File file : files) {
|
|
|
|
for (File file : files) {
|
|
|
@ -73,8 +71,7 @@ public class A8 {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (flag) continue;
|
|
|
|
if (flag) continue;
|
|
|
|
//只关心发展规模数据的表格
|
|
|
|
|
|
|
|
if (!file.getName().contains(fileNameKey)) continue;
|
|
|
|
|
|
|
|
//县区名称
|
|
|
|
//县区名称
|
|
|
|
DataEaseModel dm = new DataEaseModel();
|
|
|
|
DataEaseModel dm = new DataEaseModel();
|
|
|
|
String areaName = dm.getAreaName(file.getName());
|
|
|
|
String areaName = dm.getAreaName(file.getName());
|
|
|
|