/** * * @param file * @param index 列(0开始) * @throws Exception */ public static void readColumn(File file, int index) throws Exception{ //读取 InputStream inputStream = new FileInputStream(file.getAbsoluteFile()); Workbook workbook = Workbook.getWorkbook(inputStream); Sheet sheet = workbook.getSheet(0); int rows = sheet.getRows();//获取行 String[] phone = new String[rows]; for(int i = 1; i<rows; i++) { Cell cell = sheet.getCell(index, i); System.out.println(cell.getContents()); } }