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

This node was taken out by the NodeReaper on Apr 21, 2015 at 16:10 UTC
  • Comment on Reaped: Re^6: Making commond for large number of files

Replies are listed 'Best First'.
Re^7: Making commond for large number of files
by FreeBeerReekingMonk (Deacon) on Apr 19, 2015 at 20:10 UTC

    Explain to me in pseudo-code what needs to be done, and how it needs to be done in detail. Do that, and the algorithm can be written in Perl.

        First, we need to give the script the name of the file with the minimal EDR. Then, we can code this before the foreach loop

        # get minimal EDR filename from commandline my $minEDRfile = shift; my $MinEDRstr = `grep -A37 "EDR alpha" $f | tail -n35|awk "{print \\\$ +4+\\\$5}"`; my @MinEDRvars = split(/\n/,$MinEDRstr);

        Then, inside the loop, at the print, we add an extra column to the sprintf statement:

        # Print the outputs foreach my $i(0..$NU-1){ print F sprintf("%8.3E %12.6E %12.6E %12.6E\n", $R,$Uvars[$i],$EDRvars[$i], $EDRvars[$i] - $MinEDRvars[$i] ); }

        And so, we call it:

        ./process.pl min_EDR_filename.log