title: Count lines and text strings in muliple csv files in linux and pipe to a csv file
body: <p>How would i traver though a folder containing multiple cvs files and:</p>
  
  <ol>
  <li>Count non-empty lines</li>
  <li>Count lines containing:
  a. "Time Out"
  b. "Mortality"
  c. "Init"</li>
  </ol>
  
  <p>An pipe that to a csv file in the format:</p>
  
  <p>Filename  "Line Count"  "Time Out"   "Mortality"   "Init"</p>
  
  <p>in command line in Linux?</p>
  
  <p>Edit:</p>
  
  <pre><code>wc -l ./*.csv &gt; result.txt
  </code></pre>
  
  <p>And was able to get the count of the lines, but am unsure about find strings as stated above.</p>
  
  <p>I edited according to shellcheck.net and got this:</p>
  
  <pre><code>#!/bin/bash
  
  find ./ -type f -exec cat {} &gt; /tmp/file.tmp \;
  cmd /tmp/file.tmp | grep Time Out | grep Mortality | grep Init &gt; /tmp/file2.tmp
  wc -l /tmp/file.tmp
  rm /tmp/file.tmp
  </code></pre>