I have some logs in a directory: /test/report. The logs are named: a.log, b.log, c.log.
The content of a.log is below:
Input 1
----
Number of records := 101
Input 2
---
Num of of records := 101
Input 3
---
Num of records := 101
The content of b.log is below:
Input1
-------
Number of records := 88
Input 2
-----
Num of of records := 88
Input 3
---
Num of records := 86
The content of c.log is below:
Input1
-------
Number of records := 4
Input 2
-----
Num of of records := 3
Input 3
---
Num of records := 4
My question is, how can I use Perl to open the files and then extract the number out so that I can have generate a report that looks like below:
Input 1 Input 2 Input 3 Result
A 101 101 101 OK
B 88 88 86 Error
C 4 3 4 Error