Me=$0 Here=`pwd` cd $HOME/work/mine/trunk/doc/06/markland worker() { printf "\n\n----| $1 |-------\n\n" silap -R $0.$1.risk -n 500 $1.csv |tee /tmp/$$ gawk -F, ' function trim(x) { sub(/^ */,"",x); sub(/ *$/,"",x); return x } Pass==1 { Names[++Names[0]]=$1 } Pass==2 { $1 = trim($1) sub(/\%/,"",$3); Data[$1]=$3 } END { for(i=1; i<=Names[0]; i++) { j= Names[i]; print (j in Data) ? Data[j] : 0 }} ' Pass=1 $Here/15.in Pass=2 /tmp/$$ > $0.$1.selected } for i in 0 1 2 3 do worker cluster${i}.data433wekaClusteredSorted cat cluster${i}.data433wekaClusteredSorted.csv > all.csv done worker all paste $0.*selected | sort -n | cat -n > /dev/null for i in *.risk do echo "=== $i ===" gawk '{X[$0]++; N++} END {for(i in X) print 100*X[i]/N " " i}' $i | sort -n done exit wc cluster*data433wekaClusteredSorted.csv ls $0.selected.* gnuplot <