title: Removing a block of text lines
body: <p>Scenario:</p>
  
  <pre><code>#Start1
  text
  text
  text
  #Start2
  text
  #Start3
  text
  text
  </code></pre>
  
  <p>As shown above, the blocks are not certain with the number of lines contained with it. Question is how to utilize <code>unix</code> command to remove one of the block say <code>#Start2</code>.</p>
  
  <p>I tried</p>
  
  <pre><code>less &lt;file_name&gt; | sed '/Start2/.+1d' | less
  </code></pre>
  
  <p>yes it probably works for this case if I can be sure how many lines are tailing the <code>#Start2</code></p>
  
  <p>But what if the number of lines tailing it is not constant each and everytime <code>#Start2</code> happens? I might fail to remove all of it or accidentally remove some content of other block.</p>
  
  <p>I need a more sophisticated way of knowing it hits the end of the block. Is there any? </p>
  
  <p>Thanks</p>