public static void main(String[] args)
  {
    File directory = new File(INPUT_DIRECTORY);
    
    String[] filenames = directory.list();
    
    BufferedWriter bw = null;
    try {
      // Output File - clear it down first.
      File outputFile = new File(OUTPUT_FILE);
      outputFile.delete();
      FileWriter fw = new FileWriter(OUTPUT_FILE,true);
      bw = new BufferedWriter(fw);
      
      bw.write("db." + COLLECTION_NAME + ".remove();\n\n");
    } catch (IOException e1) {
      e1.printStackTrace();
    }
    
    String currentLine;
    for (String fn : filenames) {
      if (fn.startsWith("IDCJAC")) {
        System.out.println(fn);
        try {
          // Set up the input files (one for min, one for max).
          FileInputStream fis = new FileInputStream(INPUT_DIRECTORY + "/" + fn);
          DataInputStream dis = new DataInputStream(fis);
          BufferedReader br = new BufferedReader(new InputStreamReader(dis));
    
          while ((currentLine = br.readLine()) != null) {
            if (currentLine.startsWith("Bureau")) { continue; }
            else {
            new RainFall(currentLine, bw, fn);
            }
          }
          
        } catch (FileNotFoundException e) {
          e.printStackTrace();
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
    }
    
    try {
      bw.write("\n\ndb." + COLLECTION_NAME + ".ensureIndex({year: 1});");
      bw.write("\ndb." + COLLECTION_NAME + ".ensureIndex({state: 1});");
      bw.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }