title: How to extract a particular pattern from a file?
body: <p>I have a file as in below format:</p>
  
  <pre><code>#### &gt;&gt;&gt; start of File
  
  Item number - 1
  Name xxxx
  yyyy
  Result PASS
  
  Item number  - 2
  Name yyyyy
  yyyy
  Result FAIL
  
  Item number - 3
  NAME ppppp
  eeee
  rrrrr
  Result PASS
  
  #### &gt;&gt;&gt; End of File
  </code></pre>
  
  <p>Now my question is, how I can extract the complete pattern from
  <code>Item number</code> to <code>Result</code> to a file? If
  <code>Result PASS</code>, I need to print  the <code>Name</code> of the pattern.</p>