main
黄海 8 months ago
parent 7468a0539c
commit 7b60bf4982

@ -99,11 +99,15 @@ public class A7 {
//县区名称
System.out.println("正在进行" + cityName + "-" + areaName + "的数据填充~");
String sourceExcel = file.getAbsolutePath();
List<List<String>> dataList = ExcelKit.readSecondTable(sourceExcel, 0, tableKeyword,
tableHeadRows, tableLetterIndex);
//取出第一行
if (dataList.isEmpty()) continue;
if (dataList.isEmpty()) {
System.out.println(areaName + ":该县区没有数据,请检查!");
System.exit(-1);
}
List<String> stringList = dataList.get(1);
//总人口

@ -417,16 +417,18 @@ public class ExcelKit {
Row row = sheet.getRow(rowIndex);
if (row != null && row.getCell(0) != null
&& row.getCell(0).toString().contains(keyword)) {
if (start == -1)
if (start == -1) {
start = rowIndex;
System.out.println("找到" + keyword + ",start=" + start);
System.out.println("找到" + keyword + ",start=" + start);
}
}
if (start > 0 && row == null) {
if (start > 0 && (row == null || row.getCell(0) == null)) {
end = rowIndex - 1;
break;
}
}
start += headRows;//第二个表的表头有几行
//System.out.println("第二个表格开始行索引=" + start + ",结束行索引=" + end);
//输出第二个表格的数据
for (rowIndex = start; rowIndex <= end; rowIndex++) {

Loading…
Cancel
Save