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

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.

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

Replies are listed 'Best First'.
Re^8: Making commond for large number of files
by acrobat118 (Initiate) on Apr 20, 2015 at 01:13 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