title: grouping lines from a txt file using filters in Linux to create multiple txt files
body: <p>I have a txt file, where each line starts with participant No, followed by the date and other variables (numbers only), so has format:   </p>
  
  <pre><code> S001_2 20090926 14756 93    
   S002_2 20090803 15876 13    
  </code></pre>
  
  <p>I want to write a script that creates smaller txt files containing only 20 participants per file (so first one will contain lines from S001_2 to S020_2;second from S021_2 to S040_2; total number of subjects approximately 200). However, subjects are not organized, therefore I can`t set a range with sed.</p>
  
  <p>What would be the best command to filter ppts into chunks depending on what number (SOO1_2) the line starts with?</p>
  
  <p>Thanks in advance.</p>