What[1]=j48 What[2]=nBayes What[3]=jRip What[4]=which2 for i in 1 2 3 4; do grep "${What[$i]}," accuracy.csv | cut -d, -f $i | sort -n | gawk '{M*100 + (++N) "\t" $0}' M=$i |tee /tmp/${What[$i]}.dat done