title: Split large file according to value in single column (AWK)
body: <p>I would like to split a large file (10^6 rows) according to the value in the 6th column (about 10*10^3 unique values). However, I can't get it working because of the number of records. It should be easy but it's taking hours already and I'm not getting any further.</p>
  
  <p>I've tried two options:
  <br>Option 1</p>
  
  <pre><code>awk '{print &gt; $6".txt"}' input.file
  awk: cannot open "Parent=mRNA:Solyc06g051570.2.1.txt" for output (Too many open files)
  </code></pre>
  
  <p>Option 2</p>
  
  <pre><code>awk '{print &gt; $6; close($6)}' input.file 
  </code></pre>
  
  <p>This doesn't cause an error but the files it creates contain only the last line corresponding to 'grouping' value $6</p>
  
  <p>This is the beginning of my file, however, this file doesn't cause an error because it's so small:</p>
  
  <pre><code>exon    3688    4407    +   ID=exon:Solyc06g005000.2.1.1    Parent=mRNA:Solyc06g005000.2.1
  exon    4853    5604    +   ID=exon:Solyc06g005000.2.1.2    Parent=mRNA:Solyc06g005000.2.1
  exon    7663    7998    +   ID=exon:Solyc06g005000.2.1.3    Parent=mRNA:Solyc06g005000.2.1
  exon    9148    9408    +   ID=exon:Solyc06g005010.1.1.1    Parent=mRNA:Solyc06g005010.1.1
  exon    13310   13330   +   ID=exon:Solyc06g005020.1.1.1    Parent=mRNA:Solyc06g005020.1.1
  exon    13449   13532   +   ID=exon:Solyc06g005020.1.1.2    Parent=mRNA:Solyc06g005020.1.1
  exon    13711   13783   +   ID=exon:Solyc06g005020.1.1.3    Parent=mRNA:Solyc06g005020.1.1
  exon    14172   14236   +   ID=exon:Solyc06g005020.1.1.4    Parent=mRNA:Solyc06g005020.1.1
  exon    14717   14803   +   ID=exon:Solyc06g005020.1.1.5    Parent=mRNA:Solyc06g005020.1.1
  exon    14915   15016   +   ID=exon:Solyc06g005020.1.1.6    Parent=mRNA:Solyc06g005020.1.1
  exon    22106   22261   +   ID=exon:Solyc06g005030.1.1.1    Parent=mRNA:Solyc06g005030.1.1
  exon    23462   23749   -   ID=exon:Solyc06g005040.1.1.1    Parent=mRNA:Solyc06g005040.1.1
  exon    24702   24713   -   ID=exon:Solyc06g005050.2.1.3    Parent=mRNA:Solyc06g005050.2.1
  exon    24898   25402   -   ID=exon:Solyc06g005050.2.1.2    Parent=mRNA:Solyc06g005050.2.1
  exon    25728   25845   -   ID=exon:Solyc06g005050.2.1.1    Parent=mRNA:Solyc06g005050.2.1
  exon    36352   36835   +   ID=exon:Solyc06g005060.2.1.1    Parent=mRNA:Solyc06g005060.2.1
  exon    36916   38132   +   ID=exon:Solyc06g005060.2.1.2    Parent=mRNA:Solyc06g005060.2.1
  exon    57089   57096   +   ID=exon:Solyc06g005070.1.1.1    Parent=mRNA:Solyc06g005070.1.1
  exon    57329   58268   +   ID=exon:Solyc06g005070.1.1.2    Parent=mRNA:Solyc06g005070.1.1
  exon    59970   60505   -   ID=exon:Solyc06g005080.2.1.24   Parent=mRNA:Solyc06g005080.2.1
  exon    60667   60783   -   ID=exon:Solyc06g005080.2.1.23   Parent=mRNA:Solyc06g005080.2.1
  exon    63719   63880   -   ID=exon:Solyc06g005080.2.1.22   Parent=mRNA:Solyc06g005080.2.1
  exon    64143   64298   -   ID=exon:Solyc06g005080.2.1.21   Parent=mRNA:Solyc06g005080.2.1
  exon    66964   67191   -   ID=exon:Solyc06g005080.2.1.20   Parent=mRNA:Solyc06g005080.2.1
  exon    71371   71559   -   ID=exon:Solyc06g005080.2.1.19   Parent=mRNA:Solyc06g005080.2.1
  exon    73612   73717   -   ID=exon:Solyc06g005080.2.1.18   Parent=mRNA:Solyc06g005080.2.1
  exon    76764   76894   -   ID=exon:Solyc06g005080.2.1.17   Parent=mRNA:Solyc06g005080.2.1
  exon    77189   77251   -   ID=exon:Solyc06g005080.2.1.16   Parent=mRNA:Solyc06g005080.2.1
  exon    80044   80122   -   ID=exon:Solyc06g005080.2.1.15   Parent=mRNA:Solyc06g005080.2.1
  exon    80496   80638   -   ID=exon:Solyc06g005080.2.1.14   Parent=mRNA:Solyc06g005080.2.1
  </code></pre>