title: Search for string then print the next line from text file
body: <p><strong>Update: I figured it out. See below.</strong></p>
  
  <p>I'm trying to find a specific string in a text document. Once I find the string the only thing I want to print is the information in the lines following it until there is a blank line. I've been able to find the string and print, but I'm always printing the line that contains the string first. </p>
  
  <p>Example:</p>
  
  <p>I search for Ted in this doc:</p>
  
  <pre><code>blah blah
  ted
  blah blah
  blah
  bl
  
  mike
  </code></pre>
  
  <p>Now I print: <code>ted blah blah blah bl</code><br>
  I want: <code>blah blah blah bl</code></p>
  
  <p>I thought maybe <code>nextline()</code> but I honestly have no idea how to use scanner since we are using textIO instead in my class. </p>
  
  <pre><code>public static void main(String[] args) {
  
      boolean output=false; 
      String name=""; 
      String junk="CHAMBERS";
      TextIO.putln("Search name:");
      name = TextIO.getln();      
      TextIO.readFile("doc.txt"); 
      name = name.toUpperCase();
      TextIO.putln(name + "'s "+"Info");
  
      output = false; 
      while (false == TextIO.eof()) {
          String line = TextIO.getln(); 
          if (line.isEmpty())
              output = false; 
          if (line.indexOf(name) &gt;= 0 &amp;&amp; line.indexOf(junk)&lt;=0){
              output = true; 
          }       
          if (output){
            line=line.trim();
            TextIO.putln(name+":"+'"'+line+'"');}
      }
  
      TextIO.putln();
  
  }
  </code></pre>
  
  <p>Since I can't answer my own question I'll put this here:</p>
  
  <p>In the If(output) tree:</p>
  
  <pre><code>if (output){
  line=line.trim();
  if (line.startsWith(name)){}
  else{
  TextIO.putln('"'+line+'"');}}
  </code></pre>
  
  <p>This checks the line for the string 'name' then ignores it. Then it goes on to the next line. I had to use trim() in case some lines had spaces before the name. This is the only way I found, as a newbie, to avoid constantly creating new lines for each time it finds 'name'. I removed some formatting that was required to make this a more general solution to the problem. </p>