Skipping certain parts of a textfile while reading in java
<p>I have a text file that I am reading. It has chunks that I would want to remove. Is there a way I can say If the reader comes across a String "STATEMENT OF ACCOUNT" it skips reading the 10 lines before that Statement. This is the code I am currently using which is reading everything from the Text file.</p>

<pre><code>  for(int i = 0; i &lt; filenames.length; i++){
   FileInputStream fstemp = new FileInputStream("C:/Temporary/" + filenames[i]); 
   FileOutputStream fos = new FileOutputStream("C:/Statements/" + filenames[i]);  
   DataInputStream in1 = new DataInputStream(fstemp);
   UniqueLineReader brtemp = new UniqueLineReader(new InputStreamReader(in1));
   BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fos));
   String strLine;
   while((strLine = brtemp.readLine()) != null){
     bw.write(strLine);
     bw.newLine();
     bw.flush();

   }


    }
</code></pre>
