title: how to extract a record in a text on string match in a file using windows bash
body: <p>Hi i have a text file sampple.txt as</p>
  
  <pre><code>    =====record1
      title:javabook
      price:$120
      author:john
      path:d:
      =====record2
      title:.netbook
      author:paul
      path:f:
      =====record3
      author:john
      title:phpbook
      subject:php
      path:f:
      price:$150
      =====record4
      title:phpbook
      subject:php
      path:f:
      price:$150
  </code></pre>
  
  <p>from this i want to split the data based on author, it should split into 2 files which contains</p>
  
  <pre><code>test1.txt
  
  =====record1
      title:javabook
      price:$120
      author:john
      path:d:
  =====record3
      author:john
      title:phpbook
      subject:php
      path:f:
      price:$150
  </code></pre>
  
  <p>and</p>
  
  <pre><code>test2.txt
  
  =====record2
      title:.netbook
      author:paul
      path:f:
  </code></pre>
  
  <p>like above i want to classify the main sample.txt file into sub files based on author field dynamically please suggest me a way to do it.</p>