title: How to get rows with values more than 2 in at least 2 columns?
body: <p>I am trying to extract row where value is >=2 in atleast two column. My input file look like this </p>
  
  <pre><code>gain,top1,sos1,pho1
  ATC1,0,0,0
  ATC2,1,2,1
  ATC3,6,6,0
  ATC4,1,1,2
  </code></pre>
  
  <p>and my awk script look like this </p>
  
  <pre><code>cat input_file | awk 'BEGIN{FS=",";OFS=","};{count&gt;=0;for(i=2; i&lt;4; i++) {if($i!=0) {count++}};if (count&gt;=2){print $0}}'
  </code></pre>
  
  <p>which doesn't give me the expected output that should be</p>
  
  <pre><code>gain,top1,sos1,pho1
  ATC3,6,6,0
  </code></pre>
  
  <p>What is the problem with this script. Thanks.</p>