java获取excel中的列号的算法

2025-01-02 16:27:59
推荐回答(1个)
回答1:

POIFSFileSystem fs=new POIFSFileSystem(new FileInputStream("d:\\test.xls"));
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(0);
HSSFRow row = sheet.getRow(0);
//f列索引位置
int index = 1;
HSSFCell cell = row.getCell((short) index);
String msg = cell.getStringCellValue();