sortColsLOO() { cat sumWinValuesLOO.txt | awk 'BEGIN{FS=","; OFS=","}{for(i=1;i<=NF;i++) $i=$i*100/(101*7); print $103,$95,$99,$92,$93,$96,$97,$98,$100,$101,$58,$59,$4,$5,$102,$13,$14,$94,$67,$68,$71,$85,$86,$17,$72,$78,$6,$70,$79,$7,$89,$76,$77,$90,$62,$8,$31,$32,$36,$84,$49,$50,$69,$87,$88,$63,$74,$9,$65,$18,$83,$56,$2,$27,$40,$41,$81,$82,$10,$47,$45,$73,$91,$53,$66,$3,$60,$54,$57,$35,$22,$23,$80,$26,$38,$11,$51,$16,$15,$44,$42,$52,$61,$39,$43,$34,$29,$48,$25,$24,$33,$12,$20,$30,$55,$64,$46,$19,$28,$37,$21,$75 }' } sortCols3Way() { cat sumWinValues3Way.txt | awk 'BEGIN{FS=","; OFS=","}{for(i=1;i<=NF;i++) $i=$i*100/(101*7); print $103,$95,$99,$92,$93,$96,$97,$98,$100,$101,$58,$59,$4,$5,$102,$13,$14,$94,$67,$68,$71,$85,$86,$17,$72,$78,$6,$70,$79,$7,$89,$76,$77,$90,$62,$8,$31,$32,$36,$84,$49,$50,$69,$87,$88,$63,$74,$9,$65,$18,$83,$56,$2,$27,$40,$41,$81,$82,$10,$47,$45,$73,$91,$53,$66,$3,$60,$54,$57,$35,$22,$23,$80,$26,$38,$11,$51,$16,$15,$44,$42,$52,$61,$39,$43,$34,$29,$48,$25,$24,$33,$12,$20,$30,$55,$64,$46,$19,$28,$37,$21,$75 }' } printRowsLOO(){ local rows="20 17 2 6 3 9 15 5 13 8 7 18 14 11 19 12 16 4 10 21" local tmp=~/tmp/crap sortColsLOO > $tmp for val in $rows; do cat $tmp | awk 'NR=='$val'{print $0}' done } printRows3Way(){ local rows="20 17 2 6 3 9 15 5 13 8 7 18 14 11 19 12 16 4 10 21" local tmp=~/tmp/crap sortCols3Way > $tmp for val in $rows; do cat $tmp | awk 'NR=='$val'{print $0}' done } # remove all previous data files rm *.dat; # separate data into subsets w.r.t. Win percentage printRowsLOO |gawk -F, '{OFS="\t"; for(i=1;i<=NF;i++) if ($i>= T1 && $i 2d0.dat printRowsLOO |gawk -F, '{OFS="\t"; for(i=1;i<=NF;i++) if ($i>= T1 && $i 2d15.dat printRowsLOO |gawk -F, '{OFS="\t"; for(i=1;i<=NF;i++) if ($i>= T1 && $i 2d30.dat printRowsLOO |gawk -F, '{OFS="\t"; for(i=1;i<=NF;i++) if ($i>= T1) print NR,i}' T1=75 > 2d60.dat gnuplot < & >=0%" with points 6 5,\ "2d15.dat" title "25%> & >=12.5%" with points 5 5,\ "2d30.dat" title "50%> & >=25%" with points 8 5,\ "2d60.dat" title ">=50%" with points 7 5 EOF epstopdf allWinValuesLOO.eps ## now print the 3 way results # remove all previous data files rm *.dat; # separate data into subsets w.r.t. Win percentage printRows3Way |gawk -F, '{OFS="\t"; for(i=1;i<=NF;i++) if ($i>= T1 && $i 2d0.dat printRows3Way |gawk -F, '{OFS="\t"; for(i=1;i<=NF;i++) if ($i>= T1 && $i 2d15.dat printRows3Way |gawk -F, '{OFS="\t"; for(i=1;i<=NF;i++) if ($i>= T1 && $i 2d30.dat printRows3Way |gawk -F, '{OFS="\t"; for(i=1;i<=NF;i++) if ($i>= T1) print NR,i}' T1=75 > 2d60.dat gnuplot < & >=0%" with points 6 5,\ "2d15.dat" title "25%> & >=12.5%" with points 5 5,\ "2d30.dat" title "50%> & >=25%" with points 8 5,\ "2d60.dat" title ">=50%" with points 7 5 EOF epstopdf allWinValues3Way.eps