title: Select lines having count greater than x and less than y using linux command
body: <p>I have the following file:</p>
  
  <pre><code>1,A 
  2,B
  3,C
  10000,D
  20,E
  4000,F
  </code></pre>
  
  <hr>
  
  <p>I want to select the lines having a count greater than <strong>10</strong> and less than <strong>5000</strong>. the output should be <strong>E</strong> and <strong>F</strong>. In C++ or any other language is a piece of cake. I really wanted to know how can I do it with a linux command.</p>
  
  <hr>
  
  <p>I tried the following command</p>
  
  <pre><code>awk -F ',' '{$1 &gt;= 10 &amp;&amp; $1 &lt; 5000} { count++ } END { print $1,$2}' test.txt
  </code></pre>
  
  <p>But it is only givine 4000,F.</p>