title: Parsing the first column of a csv file to a new file
body: <p>Operating System: OSX
  Method: From the command line, so using sed, cut, gawk, although preferably no installing modules. </p>
  
  <p>Essentially I am trying to take the first column of a csv file and parse it to a new file.</p>
  
  <p>Example input file</p>
  
  <pre><code>EXAMPLEfoo,60,6
  EXAMPLEbar,30,6
  EXAMPLE1,60,3
  EXAMPLE2,120,6
  EXAMPLE3,60,6
  EXAMPLE4,30,6
  </code></pre>
  
  <p>Desire output</p>
  
  <pre><code>EXAMPLEfoo 
  EXAMPLEbar
  EXAMPLE1
  EXAMPLE2
  EXAMPLE3
  EXAMPLE4
  </code></pre>
  
  <p>So I want the first column.</p>
  
  <p>Here is what I have tried so far:</p>
  
  <pre><code>awk -F"," '{print $1}' in.csv &gt; out.txt
  
  awk -F"," '{for (i=2;i&lt;=NF;i++)}' in.csv &gt; out.txt
  
  awk -F"," 'BEGIN { OFS="," }' '{print $1}' in.csv &gt; out.txt
  
  cat in.csv | cut -d \, -f 1 &gt; out.txt
  </code></pre>
  
  <p>None seem to work, either they just print the first line or nothing at all, so I would assume it's failing to read line by line.</p>