in reply to Re^2: Making commond for large number of files
in thread Making commond for large number of files
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Making commond for large number of files
by acrobat118 (Initiate) on Apr 18, 2015 at 17:33 UTC | |
by GotToBTru (Prior) on Apr 19, 2015 at 23:10 UTC | |
by FreeBeerReekingMonk (Deacon) on Apr 18, 2015 at 22:20 UTC | |
by acrobat118 (Initiate) on Apr 18, 2015 at 22:44 UTC | |
by GotToBTru (Prior) on Apr 19, 2015 at 22:53 UTC | |
by acrobat118 (Initiate) on Apr 20, 2015 at 01:06 UTC | |
by GotToBTru (Prior) on Apr 22, 2015 at 14:53 UTC |