Read a file from a host computer
<p>I'm trying to read a file from the computer that is in the same folder as the source code and when I run the code is saying: File does not exist
Can you help me ?</p>

<pre><code>import java.io.*;
import java.util.*;
public class Lotto1 {
  static String[][] arr;
  static String name, number;
  public static void main(String[] args) throws IOException {
    File f = new File("D:\\Filipe\\Project Final\\src\\database_lotto.txt.txt");
    Scanner s;
    try {
      s = new Scanner(f);
      BufferedReader reader = new BufferedReader(new FileReader(f));
      int lines = 0;
      while(reader.readLine() != null) {
        lines++;
      }
      reader.close();
      arr = new String[lines][3];
      int count = 0;
      //while theres still another line
      while(s.hasNextLine()) {
        arr[count][0] = s.next() + "" + s.next();
        arr[count][1] = s.next();
        arr[count][2] = s.next();
        count++;
      }
    } catch(FileNotFoundException ex) {
      System.out.println("File does not exist");
    }
</code></pre>
