perl /pyhton/bash script to get values from files and group them : i have an requirement to process values from different files. i have 5 dirs input,success,manual,retry,current. Each dir has multiple txt files. Each txt file has hostname=<hostname>. I would want to know for each hostname how many files are in input,success,retry,current and manual dir.

For eg.
input
    -> A.txt  (HOSTNAME=host1)
    -> B.txt  (HOSTNAME=host2)
    -> C.txt  (HOSTNAME=host3)
    -> D.txt  (HOSTNAME=host1)

success
    -> P.txt (HOSTNAME=host1)
    -> Q.txt (HOSTNAME=host2)
    -> 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

Would like to know if there are any libraries in perl, python or bash to do this.

Thanks
