normalize() { echo $1 gawk -F, ' Pass==1 && NR==1{for(i=1;i<=3;i++) { Min[i] = 1000000000000; Max[i] = -1 }} Pass==1 { for(i=1;i<=3;i++) { Min[i]= Min[i] > $i ? $i : Min[i] Max[i]= Max[i] < $i ? $i : Max[i] } # for(i=4;i<=6;i++) { # j = i -3 #Min[j]= Min[j] > $i ? $i : Min[j] # Max[j]= Max[j] < $i ? $i : Max[j] #} } Pass==2 { for(i=1;i<=3;i++) $i= ($i - Min[i])/(Max[i] - Min[i]) #for(i=4;i<=6;i++) $i= ($i - Min[i - 3])/(Max[i - 3] - Min[i - 3]) OFS="\t" print $0 } #END {for(i in Min) #print i " " Min[i] " " Max[i] #} ' Pass=1 $1 Pass=2 $1 } for j in ground flight OSP OSP2 do for i in fc bc bf ru do echo $i cut -d, -f 10,14,22,11,15,23 \ $HOME/svns/wisp/var/ous/bfc-rerun/STAR-ex_-f_${j}_-pol_tactical_-${i}*/simlog.csv | gawk '/[a-z]/ {next} rand() > 0.8 {print}' > ~/tmp/dat normalize ~/tmp/dat > ~/tmp/dat.tab gnuplot <