title: Cygwin CSV sort data by column
body: <h2>UPDATE 2:</h2>
  
  <p>OK I can't get this to work properly, it was working on one file but not another:</p>
  
  <pre><code>C:\cygwin\bin\sort -t"," -k5,2 c:\tmp\CI-tosplit.csv &gt; c:\tmp\CI-DEN-sorted.csv
  </code></pre>
  
  <p>This seems to sort the data but it's ignoring the header, I thought the ,2 was saying start @ line 2 which it does on one file but not another.</p>
  
  <p>All I am trying to do is sort a csv file by column 5 and keep the header.</p>
  
  <p>Thanks again for all the input.</p>
  
  <h2>UPDATED:</h2>
  
  <p>OK I've now switched to cygwin for this and I'm using the following command:</p>
  
  <pre><code>C:\cygwin\bin&gt;sort -t"," -k8 c:\tmp\test.csv &gt; c:\tmp\test-sorted.csv
  </code></pre>
  
  <p>-t to set deliminiter
  -k for column number 12</p>
  
  <p>This works, but I cannot get the header to stay in place.</p>
  
  <p>Any input would be great, thanks guys.</p>
  
  <hr>
  
  <p>I am trying to sort a CSV by a specified column using awk, but I cannot find anything that works.</p>
  
  <pre><code>sort -t, -k2 - u test.csv
  </code></pre>
  
  <p>Input file specified two times.</p>
  
  <p>Please help, I am using Windows BTW.</p>