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

  • Comment on Re^8: Making commond for large number of files

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

    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