title: reading next lines from a file after particular pattern
body: <p>I have to read a file if some pattern occurs that file i <strong>have to read next lines</strong> of the text file in java</p>
  
  <pre><code>while (sc1.hasNextLine()){
      String a = sc1.nextLine();
      String b = sc1.nextLine();
      if(a.contains("pattern")){
          //read next lines
      }
  }
  </code></pre>