title: Reading from a raw resource text file
body: <p>I'm trying to keep a .txt file in my res\raw file in Android Studio and read/parse the file.  I have a file "my_file.txt" in a folder called "raw" that I created in the "res" directory (that I didn't create).</p>
  
  <p>Here's what I think my main issue is: When creating the File object (to use with the Scanner object), what path should I pass in for my text file?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>private void readFile(){
      Scanner scanner = null;
      try {
          scanner = new Scanner(new File("\\res\\raw\\my_file.txt"));  //I've also tried without the .txt extension
          Log.v("readFile-&gt;try","Trying to read file.");
      }catch(Exception e)
      {
          //Send error message.
      }
      if(scanner != null) {
          while (scanner.hasNext()) {
              String[] line = scanner.nextLine().split("\t");
              //Process string here
          }
      }
  }
  </code></pre>