title: perl /python/bash script to get values from files and group them
body: <p>I have a requirement to process values from different files. I have 5 dirs input,success,manual,retry,current. Each dir has multiple <code>*.txt</code> files. Each <code>.txt</code> file has <code>hostname=&lt;hostname&gt;</code>. I would want to know for each hostname how many files are in input,success,retry,current and manual dir.</p>
  
  <p>For eg.</p>
  
  <pre><code>input
      -&gt; A.txt  (HOSTNAME=host1)
      -&gt; B.txt  (HOSTNAME=host2)
      -&gt; C.txt  (HOSTNAME=host3)
      -&gt; D.txt  (HOSTNAME=host1)
  
  success
      -&gt; P.txt (HOSTNAME=host1)
      -&gt; Q.txt (HOSTNAME=host2)
      -&gt; R.txt (HOSTNAME=host1)
  
  OUTPUT
  Host   | Input | Success | Current | Retry | Manual
  host1  | 2     | 2       |  0      | 0     | 0
  host2  | 1     | 1       |  0      | 0     | 0
  host3  | 1     |0        |  0      | 0     | 0
  </code></pre>
  
  <p>Would like to know if there are any libraries in perl, python or bash to do this.</p>