title: Blue Pelican Java Project 24 Reading Files
body: <p>The project assignment is the following:</p>
  
  <p>Write a class called FileNerd that will input the lines of text from a file named NerdData that
  is stored in the temp_Larry folder (assuming your name is Larry). After the file input loop,
  create a loop in which you printout only those lines that begin with the word “The”.</p>
  
  <p>So this is what I have so far</p>
  
  <pre><code>import java.util.*;
  import java.io.*;
  public class FileNerd
  {
      public static void main (String args[]) throws IOException
      {
          Scanner sf = new Scanner(new File("C:\\temp_Larry\\NerdData.txt"));
          int maxIndx = -1;
          String text[] = new String[100 ];
          while(sf.hasNext())
          {
              maxIndx++;
              text[maxIndx]=sf.nextLine();
          }
          sf.close();
  
          for(int j = 0; j &lt;= maxIndx; j++)
          {
              String q = text[j];
  
              if( q.substring(3).equals("The"))
              {
                  System.out.println(q);
              }
          }
      }
  }
  </code></pre>
  
  <p>I'm not sure what I'm doing wrong because it compiles with no syntax error but nothing prints. </p>