title: How to use 'sed or gawk' to delete a text block until the third line previous the last one
body: <p>Good day,
  I was wondering how to delete a text block like this:</p>
  
  <pre><code>1    
  2    
  3    
  4    
  5    
  6    
  7    
  8
  </code></pre>
  
  <p>and delete from the second line until the third line previous the last one, to obtain:</p>
  
  <pre><code>1    
  2    
  6    
  7    
  8
  </code></pre>
  
  <p>Thanks in advance!!!</p>
  
  <p><strong>BTW</strong> This text block is just an example, the real text blocks I working on are huge and each one differs among them in the line numbers.</p>