public class ExcelUtil extends Object
| 构造器和说明 |
|---|
ExcelUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
getCellValue(org.apache.poi.ss.usermodel.Cell cell)
获取单元格的值
|
static String |
getMergedRegionValue(org.apache.poi.ss.usermodel.Sheet sheet,
int row,
int column)
获取合并单元格的值
|
static boolean |
hasMerged(org.apache.poi.ss.usermodel.Sheet sheet)
判断sheet页中是否含有合并单元格
|
static boolean |
isMergedRegion(org.apache.poi.ss.usermodel.Sheet sheet,
int row,
int column)
判断指定的单元格是否是合并单元格
|
static boolean |
isMergedRow(org.apache.poi.ss.usermodel.Sheet sheet,
int row,
int column)
判断合并了行
|
static void |
main(String[] args) |
static void |
mergeRegion(org.apache.poi.ss.usermodel.Sheet sheet,
int firstRow,
int lastRow,
int firstCol,
int lastCol)
合并单元格
|
static void |
readContent(String fileName)
从excel读取内容
|
static ArrayList<Map<String,String>> |
readExcel(org.apache.poi.ss.usermodel.Workbook wb,
int sheetIndex,
int startReadLine,
int tailLine)
读取excel文件
|
static ArrayList<Map<String,String>> |
readExcelToObj(String path)
读取excel数据
|
static String |
remove0Suffix(Object value)
数字值,去掉.0后缀
|
public static void main(String[] args)
public static ArrayList<Map<String,String>> readExcelToObj(String path)
path - public static ArrayList<Map<String,String>> readExcel(org.apache.poi.ss.usermodel.Workbook wb, int sheetIndex, int startReadLine, int tailLine)
wb - sheetIndex - sheet页下标:从0开始startReadLine - 开始读取的行:从0开始tailLine - 去除最后读取的行public static String getMergedRegionValue(org.apache.poi.ss.usermodel.Sheet sheet, int row, int column)
sheet - row - column - public static boolean isMergedRow(org.apache.poi.ss.usermodel.Sheet sheet,
int row,
int column)
sheet - row - column - public static boolean isMergedRegion(org.apache.poi.ss.usermodel.Sheet sheet,
int row,
int column)
sheet - row - 行下标column - 列下标public static boolean hasMerged(org.apache.poi.ss.usermodel.Sheet sheet)
sheet - public static void mergeRegion(org.apache.poi.ss.usermodel.Sheet sheet,
int firstRow,
int lastRow,
int firstCol,
int lastCol)
sheet - firstRow - 开始行lastRow - 结束行firstCol - 开始列lastCol - 结束列public static String getCellValue(org.apache.poi.ss.usermodel.Cell cell)
cell - public static void readContent(String fileName)
Copyright © 2023. All rights reserved.