#! /bin/bash File="cocomost_3.log" OutFile="cocomostTable.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,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 done done