title: How can i remove multiple lines from a file based on a pattern that spans multiple lines?
body: <p>I have a text formatted like the following:</p>
  
  <pre><code>2020-05-02
  apple
  string
  string
  string
  string
  string
  2020-05-03
  pear
  string
  string
  string
  string
  string
  2020-05-03
  apple
  string
  string
  string
  string
  string
  </code></pre>
  
  <p>Each group has <code>7</code> lines = Date, Fruit and then 5 strings.</p>
  
  <p>I would like to delete groups of <code>7</code> lines from the file by supplying just the date and the fruit.</p>
  
  <p>So if choose <code>'2020-05-03'</code> and <code>'pear'</code></p>
  
  <p>this would remove:</p>
  
  <pre><code>2020-05-03
  pear
  string
  string
  string
  string
  string
  </code></pre>
  
  <p>from the file, resulting in this:</p>
  
  <pre><code>2020-05-02
  apple
  string
  string
  string
  string
  string
  2020-05-03
  apple
  string
  string
  string
  string
  string
  </code></pre>
  
  <p>The file contains thousands of lines, I need a command, probably using sed or awk to:</p>
  
  <ol>
  <li><p>Search for date <code>2020-05-03</code></p></li>
  <li><p>Check if string after date is <code>pear</code></p></li>
  <li><p>delete both lines and following <code>5</code> lines</p></li>
  </ol>
  
  <p>I know i can delete with sed like <code>sed s'/string//g'</code>, however i am not sure if i can delete multiple lines.</p>
  
  <p>Note: 
  Date followed by fruit is never repeated twice
  so </p>
  
  <pre><code>2020-05-02
  pear
  </code></pre>
  
  <p>would only occur once in the file</p>
  
  <p>How can i acheive this?</p>