Ok, great, that looks like a great start. I was checking http://nbo6.chem.wisc.edu/tut_del.htm and I assume now that EDu is the calculated energy of the Delocalization (some seem to call it deletion) in atomic units. And what you need to calculate is the Energy Delocalization Range. How about this:

#!/usr/bin/perl # Write a single output file with # Bond_length Delocalization_range EDR # from each calculation here use strict; my $ELowSoFar = undef; # The lowest energy found so far my $FileLowSoFar = ''; # The file containing the lowest energy so far my %FILE2SCF; # $FILE2SCF{"FILENAME"} = Energy foreach my $file (<*log>){ # Loop over all of the files my $E=`grep "SCF Done" $file|awk "{print \\\$5}"`; chomp($E);# + Find the energy in this file # Check if the energy in this file is LOWER than the lowest en +ergy so far if (!defined $ELowSoFar || $ELowSoFar>$E){ # If it is, then it is the NEW lowest energy so far $ELowSoFar = $E; # and the file containing is the new FileLowSoFar $FileLowSoFar = $file; }; # store the energy of the file for later use $FILE2SCF{$file} = $E; print "File $file has energy $E and the lowest energy so far i +s $ELowSoFar\n"; } print "The lowest total energy was $ELowSoFar\n"; print "This was in file $FileLowSoFar\n"; # Now calculate Delocalization_range for each files my $minimalvalue = $FILE2SCF{$FileLowSoFar}; for my $file (sort keys %FILE2SCF){ my $currentvalue = $FILE2SCF{$file}; print "$file: Energy Delocalization Range=". ($currentvalue-$minimal +value)."\n"; }

In reply to Re^3: Making commond for large number of files by FreeBeerReekingMonk
in thread Making commond for large number of files by acrobat118

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.