Hi all. For those of you who are familier with perl I have a question.
Does any one know how else to read in information from a .dat file as some
of my macro works (concerning BRBR) but the other parts don't.
The non-working parts are for "Data 1' bin" and "mnuSqHigh".
Cheers, CC.
See below:
#!/usr/bin/perl
#BRBR NOT partialBRBR for Asym stuff.
#my @ip=("r15");
my @ip=("0","1","2","3","4","5","6","7","8","9","10");
foreach $j(@ip){
# open(FILE,"> 1D$j\GenQ2cut2_N.txt");
open(FILE,"> 1Dr15GenQ2cut2_N$j.dat");
# for($i=0;$i<11;$i++){
#my $JOB= "~/scra/Ibusys_MCENR_ip$j\_$i";
#my $JOB= "~/scra/sysIP0.20/Ibusys_MCENR_ip\$j\_$i";
# my $JOB= "~/scra/sysSP_dataMCIP0.20nopi0/Ibu$j\_SPip020nopi0_$i";
# my $JOB= "~/scra/sysSP_dataMCIP0.20pi0/Ibu$j\_SPip020pi0_$i";
# my $JOB= "~/scra/sysSP_dataMCIP0.20/Ibu$j\_SPip020_$i";
# my $JOB= "~/scra/NewSysSP_dataMCIP0.$j\/Ibu1_SPip0$j\_$i";
# my $JOB= "~/scra/q2Cut/Ibu1_SPip020$j\_GenQ2cut$i";
# my $JOB= "~/scra/Ibunew1D$j\GenQ2cut2_C$i";
# my $JOB= "~/scra/Ibunew1D$j\GenQ2cut2_N$i";
my $JOB= "~/scra/1D-Jobs/Ibunew1Dr15GenQ2cut2_N$j";
print "$JOB\n";
my $OUTFILE = "$JOB/\*.dat";
$line=`grep "BRBR " $OUTFILE`;
my($puppa,$bf,$sterr,$mcer)=split(" ",$line);
print FILE "q2 $j BRBR $bf $sterr $mcer \n";
$line=`grep "Data 1' bin = " $OUTFILE`;
my($puppa,$bf,$sterr,$mcer)=split(" ",$line);
print FILE "data1bin $bf $sterr $mcer \n";
chomp($line);
$line=`grep "mnuSqHigh" $JOB | awk '{print \$2}'`;
chomp($line);
print FILE "mm2 $line 0. 0. \n";
$line=`grep "Data 1' bin" $JOB | awk 'BEGIN{FS="("}{print \$1,\$2}' |
awk '{print \$6,\$8,\$12}'`;
chomp($line);
print FILE "data1bin $line 0. \n";
close FILE;
}
exit;
|