text: user7236: I have a file like this with 2 columns. I want to separate the columns based on plus and minus signs into separate files. How do I do this with awk or sed. Kindly help.    
  
  
  user4001: awk '{if($2>0) print $0}' expressionFile.txt >> positiveExpression.txt
  awk '{if($2<0) print $0}' expressionFile.txt >> negativeExpression.txt
  
  Assuming that the file with gene expressions has the title: expressionFile.txt, this should do the trick.
  Explanation of first line of code: if values in the 2nd column - $2 - are greater than 0, print all columns ($0) and write to a file (>>) titled, positiveExpression.txt. The use of awk '{}' is just syntactical. 
  
  user8919: What do you want to do with NA values?
  The below scripts ignore them (h3ab74's answer will print them to positiveExpression)
  awk '$2 ~ /^[0-9]+$/  {print $0}' expressionFile.txt > positiveExpression.txt
  awk '$2 ~ /^-[0-9]+$/ {print $0}' expressionFile.txt > negativeExpression.txt
  
  These do a regex match to respectively, positive and negative numbers. If there's anything else in field 2 the line won't be printed. 
  
original_text: 7236: <p>I have a file like this with 2 columns. I want to separate the columns based on plus and minus signs into separate files. How do I do this with awk or sed. Kindly help.    </p>
  
  <p><a href="https://i.stack.imgur.com/my8CN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/my8CN.png" alt="enter image description here"></a></p>
   4001: <pre><code>awk '{if(<span class="math-container">$2&gt;0) print $</span>0}' expressionFile.txt &gt;&gt; positiveExpression.txt
  awk '{if(<span class="math-container">$2&lt;0) print $</span>0}' expressionFile.txt &gt;&gt; negativeExpression.txt
  </code></pre>
  
  <p>Assuming that the file with gene expressions has the title: expressionFile.txt, this should do the trick.</p>
  
  <p>Explanation of first line of code: if values in the 2nd column - <code>$2</code> - are greater than 0, print all columns (<code>$0</code>) and write to a file (<code>&gt;&gt;</code>) titled, positiveExpression.txt. The use of <code>awk '{}'</code> is just syntactical. </p>
   8919: <p>What do you want to do with NA values?</p>
  
  <p>The below scripts ignore them (h3ab74's answer will print them to positiveExpression)</p>
  
  <pre><code>awk '<span class="math-container">$2 ~ /^[0-9]+$</span>/  {print <span class="math-container">$0}' expressionFile.txt &gt; positiveExpression.txt
  awk '$</span>2 ~ /^-[0-9]+<span class="math-container">$/ {print $</span>0}' expressionFile.txt &gt; negativeExpression.txt
  </code></pre>
  
  <p>These do a regex match to respectively, positive and negative numbers. If there's anything else in field 2 the line won't be printed. </p>
  