title: How to get the whole row for a if specific column has a certain text with POI
body: <p>I need to filter my excel spreadsheet for the word "GHH" anywhere in the text of a cell in a specific column. I have managed to do this by I then need to have returned the whole row that this text is found in. This I can't do as there doesnt seem to be a way of using the <code>getRowIndex</code> method to then display the whole row.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public static void main(String[] args) throws IOException {
      FileInputStream fis = new FileInputStream(new File("myfile.xls"));
      HSSFWorkbook workBook = new HSSFWorkbook(fis);
      HSSFSheet sheet = workBook.getSheetAt(0);
      Iterator &lt; Row &gt; rows = sheet.rowIterator();
      while (rows.hasNext()) {
          HSSFRow row = (HSSFRow) rows.next();
          Iterator &lt; Cell &gt; cells = row.cellIterator();
          while (cells.hasNext()) {
              HSSFCell cell = (HSSFCell) cells.next();
              if (cell.toString().contains("GHH")) {
                  String key = cell.getStringCellValue();
                  int RI = cell.getRowIndex();
              }
          }
      }
      workBook.close();
  }
  </code></pre>