title: How to grep and remove from a file all lines between a separator
body: <p>I have a file that looks like this:</p>
  
  <pre><code>===SEPARATOR===
  line2
  line3
  ===SEPARATOR===
  line5
  line6
  ===SEPARATOR===
  line8
  ...
  lineX
  ===SEPARATOR===
  </code></pre>
  
  <p>How can I do a while loop and go through the file, dump anything between two <code>===SEPARATOR===</code> occurrences into another file for further processing?
  I want to add only line2, line3 to the second file on the first iteration. I will parse the file; and on the next iteration I want line5 line6 in second file to do the same parsing again but on different data.</p>