https://issues.apache.org/bugzilla/show_bug.cgi?id=56490

--- Comment #4 from sam <[email protected]> ---
public static void main(String[] args) throws IOException
    {

      FileInputStream fileIn = new FileInputStream("C:/Lenovo/Lenovo_A.xlsx");
        XSSFWorkbook filename = new XSSFWorkbook(fileIn);
        XSSFSheet sheet = filename.getSheetAt(0);    

        String columnWanted = "Link";
        Integer columnNo = null;
        List <Cell> cells = new ArrayList<Cell>();

        Row firstRow = sheet.getRow(0);
        for (Cell cell:firstRow){
            if(cell.getStringCellValue().equals(columnWanted)){
                columnNo = cell.getColumnIndex();
            }
        }

        if(columnNo != null){
            for (Row row: sheet){
                Cell c = row.getCell(columnNo);
                if(c == null || c.getCellType() == Cell.CELL_TYPE_BLANK){
                }
                else
                {
                    cells.add(c);
                }

                }

            }
      else
      {
          System.out.println("could not find column" + columnWanted + "in first
row of" + fileIn.toString());
          }
        }

I have this code. Now I get Exception in thread "main" at line for (Cell
cell:firstRow) with same excel file

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to