Don't ask to ask, just ask | |
PerlMonks |
Re^7: Making commond for large number of filesby GotToBTru (Prior) |
on Apr 22, 2015 at 14:53 UTC ( [id://1124274]=note: print w/replies, xml ) | Need Help?? |
I'm not really here to provide other people with programs. I rewrote your first program and you disregarded my suggestions on how to replace various grep and awk commands with Perl. Looks like you need to make two passes through your .log files. On the first one, look for the "SCF Done:" line and pull out the value. When you see a value larger than you have seen before, remember it, the file name, and build up an array like @EDRvars to record the sum of the EDRA and B values - maybe call it @bigEDRvars. This array you will use in the second part of the program to subtract from the values you get from the other log files. The second time thru the file list, add the following to your foreach loop:
where $big_file contains the name of the file you found in the first loop. The rest of the program can be pretty much as I have already provided, with one addition to the printf where you subtract the $bigEDRvars[$i] value from $EDRvars[$i]. When you get that done, if it still doesn't work, post the code here and we can make suggestions.
In Section
Seekers of Perl Wisdom
|
|