#! /bin/bash File="cocomost_3.log" OutFile="cocomostStats.csv" rm -f $OutFile TmpFile="tmp.tmp" #FILENAME,I,SEED,LEARNER,SUBSET,ESTIMATE,ACTUAL,MRE DataSet="coc81 nasa93" LearnerSet="LC cocomost" echo "#FILENAME,LEARNER,MMRE,SD(MRE),PRED30,CORR,AVG_COLUMNS" > $OutFile for Data in $DataSet do for Learner in $LearnerSet do grep $Data $File | grep $Learner > $TmpFile #MMRE=$(gawk -f avgcolumn.awk I=8 $TmpFile) AvgCol=$(gawk -f avgattributes.awk I=5 $TmpFile) #echo $Data","$Learner","$MMRE","$AvgCol >> $OutFile #"MMRE, SD(MRE), PRED30, CORR" Results=$(gawk 'BEGIN{FS=",";OFS=","}NR==1{next}{print $6,$7}' $TmpFile | gawk -f calc.awk) echo $Data","$Learner","$Results","$AvgCol >> $OutFile done done #gawk 'BEGIN{FS=",";OFS=","}NR==1{next}{print $6,$7}' cocomost_3.log | gawk -f calc.awk