title: Why awk script does not work on Mac OS but works on Linux?
body: <p>I have this awk script that I use to filter genes that are differentially expressed. I have a csv file that was created in R.</p>
  
  <pre><code> #Command to get DE genes
  awk -F '\t' '$14 &lt; 0.05 &amp;&amp; $10 &lt; -1 &amp;&amp; $7 &gt; 1 { print &gt; "Genes-Down.csv" }
               $14 &lt; 0.05 &amp;&amp; $10 &gt; +1 &amp;&amp; $8 &gt; 1 { print &gt; "Genes-Up.csv" }' Results-RPKMs.csv
  </code></pre>
  
  <p>I started doing all my analyses on Mac OS now and the same command does not work. It also does not give any error message. It runs and nothing happens. I also had same problems with other sed commands, but it was easy to make new ones using awk.</p>
  
  <hr>
  
  <p>Update:
     The MacOS X awk is version 20070501. However, the Ubuntu machine has mawk 1.3.3. The command awk --version wouldn't work. Had to use awk -W --version. So I think that is why it works on Ubuntu but was not working in MacOSX. So I downloaded mawk and installed it using fink and now the command works in MacOSX. Thanks for your help.</p>
  
  <p>Update2: Actually the problem was not awk. Usually I create the csv files in R. Then I just run the script to do the filtering. Turns out that if I open the csv files in Excel or save an Excel file in csv format then the script does not work (tried several times with different delimiters). Apparently if you save a spreadsheet as .csv in MacOX (Excel 2011) and try to open it back in Excel it says that it is a SYLK file. There is a description of this on Microsoft website. If I use OpenOffice, it works just fine.</p>