title: Read multiple files from different folders in Java
body: <p>What is the best way for parsing multiple files from multiple directories?</p>
  
  <p>I have a folder that contains 51 sub folders and each sub folder contains 100 files. </p>
  
  <p>I know how to scan one single file using </p>
  
  <pre><code>File dataFile = new File("A.txt");
      scan = new Scanner (dataFile);
  
      while (scan.hasNext()){ 
          System.out.print(scan.next() + "\t");
      }
  </code></pre>
  
  <p>but how to generalize this to read from the different directories ?</p>