title: Read Excel File in Java Using POI - Iterator Errors
body: <p>i need to compare between two excel files.
  i'm using POI API.
  i want to go over the first excel file, get the row id from the first cell in each line, and then go over the second excel file, find the the line with the row id, and compare between the cells' value of the two files.</p>
  
  <p>my problem now, is that i'm getting an error messege when i'm defining Iterator (both Row and Cell).</p>
  
  <p>i have tried both ways:
  Iterator file1Row = file1Sheet.rowIterator(); 
  and
  Iterator file1Row = file1Sheet.rowIterator();</p>
  
  <p>and both of them are not acceptable.</p>
  
  <p>Can some one please try to advise what i;m doing worng and what can solve it?</p>
  
  <p>see the code i have been writing till now below.</p>
  
  <p>Thanks</p>
  
  <pre><code>import java.io.BufferedReader;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileReader;
  import java.io.IOException;
  import java.io.FileNotFoundException;
  import java.io.InputStreamReader;
  import java.io.FileOutputStream;
  import java.io.InputStream; 
  import java.io.DataInputStream;
  import java.io.InputStream.*;
  import java.util.*;
  
  import org.apache.poi.hssf.usermodel.*; 
  import org.apache.poi.hssf.usermodel.HSSFRow;
  
  import org.apache.poi.poifs.filesystem.POIFSFileSystem;
  
  
   public class CompareRanks {
  public static void main(String[] args) throws IOException {
  String file1Path = "C:/Documents/File1.csv";    
       String file2Path  = "C:/Documents/File2.xls";
  //Read file1
  try{
  
      FileInputStream File1 = new FileInputStream(file1Path );
      POIFSFileSystem File1System = new POIFSFileSystem (File1);
  
      HSSFWorkbook File1Workbook = new HSSFWorkbook(File1System);
      HSSFSheet File1RankSheet = File1Workbook.getSheetAt(0);
      Iterator File1Row = File1RankSheet .rowIterator(); //Error
  
       } catch (FileNotFoundException ex) {
          ex.printStackTrace();
  
       } finally {
       //Close the ObjectInputStream
  
   }  
  </code></pre>
  
  <p>}</p>