title: Fetching column X from an Excel file using Java program
body: <p>I have an Excel sheet in which i have close to 150 columns. I am writing an utility where in it will fetch a column where the column name is say X. In another thread i saw how to read the XL workbook and the sheet.. Have written following code.. </p>
  
  <pre><code>        HSSFSheet sheet = workbook.getSheetAt(0);
          Iterator rows = sheet.rowIterator();
  
  
          while (rows.hasNext()) 
          {
              HSSFRow row = (HSSFRow) rows.next();
              Iterator cells = row.cellIterator();
  
              List data = new ArrayList();
              while (cells.hasNext()) 
              {
                  HSSFCell cell = (HSSFCell) cells.next();
                  data.add(cell);
              }
  
              sheetData.add(data);
          }
      } 
  </code></pre>
  
  <p>So how to fetch the exact column from the XL sheet given the column name.. ? </p>