title: Read one row per time / only specific column and create object
body: <p>I using Apache poi to import an .xlsx file that I have in my desktop area.</p>
  
  <p>With the below code I can read the hole sheet that I want.</p>
  
  <p>But I want to read only one line per time and only specific columns per line (for example I want only column A, F and G from the first line and save it as object, then the same for the second line, third line etc )</p>
  
  <p>How can I do it?</p>
  
  <pre><code>public class main {
          public static void main( String[] args ) throws Exception {
              InputStream ExcelFileToRead = new FileInputStream("C:/User/Desktop/test.xlsx");
              XSSFWorkbook wb = new XSSFWorkbook(ExcelFileToRead);
  
              XSSFSheet sheet=wb.getSheetAt(0);
              XSSFRow row;
              XSSFCell cell;
  
              Iterator rows = sheet.rowIterator();
  
  
              while (rows.hasNext())
              {
                  row=(XSSFRow) rows.next();
                  Iterator cells = row.cellIterator();
  
                  while (cells.hasNext())
                  {
                      cell=(XSSFCell) cells.next();
  
                      if (cell.getCellType() == XSSFCell.CELL_TYPE_STRING)
                      {
                          System.out.print(cell.getStringCellValue()+" ");
                      }
                      else if(cell.getCellType() == XSSFCell.CELL_TYPE_NUMERIC)
                      {
                          System.out.print(cell.getNumericCellValue()+" ");
                      }
                      else
                      {
                      }
                  }
                  System.out.println();
              }
          }
      }
  </code></pre>