Commit 959ee4c20428fa497bc5e503f365a790a95076c7
1 parent
3e214bbc
Exists in
master
.
Showing
2 changed files
with
6 additions
and
4 deletions
Show diff stats
build.gradle
src/main/java/com/taover/util/UtilExcel.java
| ... | ... | @@ -321,8 +321,9 @@ public class UtilExcel { |
| 321 | 321 | |
| 322 | 322 | }else if(currCellType.compareTo(CellType.BOOLEAN) == 0){ |
| 323 | 323 | dataRow.add(cell.getBooleanCellValue()); |
| 324 | - }else if(currCellType.compareTo(CellType.FORMULA) == 0 | |
| 325 | - || currCellType.compareTo(CellType.BLANK) == 0 | |
| 324 | + }else if(currCellType.compareTo(CellType.FORMULA) == 0){ | |
| 325 | + dataRow.add(cell.getStringCellValue()); | |
| 326 | + }else if(currCellType.compareTo(CellType.BLANK) == 0 | |
| 326 | 327 | || currCellType.compareTo(CellType.ERROR) == 0){ |
| 327 | 328 | dataRow.add(""); |
| 328 | 329 | } |
| ... | ... | @@ -394,10 +395,11 @@ public class UtilExcel { |
| 394 | 395 | |
| 395 | 396 | public static void main(String args[]){ |
| 396 | 397 | //String filepath = "C:\\Users\\root\\Desktop\\千丁-6.27.xlsx"; |
| 397 | - String filepath = "C:\\Users\\EDZ\\Desktop\\gaoming测试甩单.csv"; | |
| 398 | + String filepath = "C:\\Users\\EDZ\\Desktop\\榴莲1 (5).xlsx"; | |
| 398 | 399 | List<List<Object>> data = null; |
| 399 | 400 | try { |
| 400 | 401 | data = UtilExcel.readExcel(filepath); |
| 402 | + System.out.println(data); | |
| 401 | 403 | System.out.println(data.size()); |
| 402 | 404 | System.out.println(UtilExcel.readExcelExcludeHideLine(filepath).size()); |
| 403 | 405 | } catch (Exception e) { | ... | ... |