Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^7: Making commond for large number of files

by GotToBTru (Prior)
on Apr 22, 2015 at 14:53 UTC ( [id://1124274]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Making commond for large number of files
in thread Making commond for large number of files

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:

next if $f eq $big_file;

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.

Dum Spiro Spero

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1124274]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-23 11:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found