gravatar for deep771992chanda

3 hours ago by

I have a around 50 files which are named in the format: ERR*.log (i.e. ERR23432.log, ERR12356.log, and so on...). From each file I want to extract a specific information (value).

Within each file, there are values at the end of the lines: final pair1 : Total reads after merging results from multiple database and final pair2 : Total reads after merging results from multiple databases. You can see these lines in the 62nd and 63rd line of the attached file.

Now, I want a script that will extract these values and add them to get a single value for each file. And then, it will give an output file with the extracted information where the first column will be the name of the file without the extension (i.e. ERR45666 in the attached example) and the second column with the added value. Can anyone please help me out?

Source link