title: How do easily filter CSV data in Ruby
body: <p>I am dealing with a CSV file(approx 500 lines). Is there a way to select data from this file with filters. I know I can do this in ruby by parsing the csv and using select/find methods But I am looking for a simpler syntax. I don't want to write methods to process each of the below queries. Any gem that would allow me do these queries? I am looking for a non-Rails solution as I am writing a plain ruby script.</p>
  
  <p>e.g.</p>
  
  <pre><code>csv.find_rows(where: {'GENDER' =&gt; 'MALE'}.count
  </code></pre>
  
  <p>or</p>
  
  <pre><code>csv.find_rows(where: {'GENDER' =&gt; 'MALE', 'SALARY' &gt;= 10000 }
  </code></pre>