title: Count specific word in file with
body: <p>Im trying to count the number of occurrences of a word in a comma seperated file, using python.</p>
  
  <p>I have a file that contains strings like this:</p>
  
  <pre><code>path/to/app1,app1,fail,my@email.com,logfile.log
  path/to/app2,app2,success,my@email.com,logfile.log
  </code></pre>
  
  <p>I want to find the out how many times "fail" is in the file.</p>
  
  <p>I tried several things including</p>
  
  <pre><code>for line in lines:
     if line.split(',') == "fail":
         fails += 1
  </code></pre>