title: UNIX sed: How to remove lines with pattern if next line is not a number(or matches the same pattern)?
body: <p>Here is sample text file:    </p>
  
  <pre><code>$ cat text.txt
  Checking log log0.txt
  12
  Checking log log1.txt
  Checking log log2.txt
  34
  56
  78
  Checking log log3.txt
  Checking log log4.txt
  Checking log log5.txt
  90
  </code></pre>
  
  <p>How to process it using sed (or any other tool), so it will look like this:</p>
  
  <pre><code>$ cat text.txt
  Checking log log0.txt
  12
  Checking log log2.txt
  34
  56
  78
  Checking log log5.txt
  90
  </code></pre>
  
  <p>Pattern is "Checking"</p>
  
  <p>Update:
  If last line has "Checking" pattern, it should be removed as well.</p>