title: Splitting a large txt file into 200 smaller txt files on a regex using shell script in BASH
body: <p>I hope the subject is clear enough, I haven't found anything specifically about this in the previously asked bin. I've tried implementing this in Perl or Python, but I think I may be trying too hard.</p>
  <p>Is there a simple shell command / pipeline that will split my 4mb .txt file into seperate .txt files, based on a beginning and ending regex?</p>
  <p>I provide a short sample of the file below.. so you can see that every &quot;story&quot; starts with the phrase &quot;X of XXX DOCUMENTS&quot;, which could be used to split the file.</p>
  <p>I think this should be easy and I'd be surprised if bash can't do it - faster than Perl/Py.</p>
  <p>Here it is:</p>
  <pre><code>                           1 of 999 DOCUMENTS
  
  
                Copyright 2011 Virginian-Pilot Companies LLC
                            All Rights Reserved
                     The Virginian-Pilot(Norfolk, VA.)
  
  ...
  
  
  
                             3 of 999 DOCUMENTS
  
  
                    Copyright 2011 Canwest News Service
                            All Rights Reserved
                            Canwest News Service
  
  ...
  </code></pre>
  <p>Thanks in advance for all your help.</p>
  <p>Ross</p>