# /* vim: set filetype=sh : */ -*- awk -*- make -s parents gnuplot=/Users/timm/Desktop/gnuplot-4.0.0/src/gnuplot gnuplot=gnuplot Here=`pwd` All=`./File` cd $HOME/work/mine/trunk/doc/06/markland/ Files="data.eo2 data.xf3 data.rand data.go4 data.gs1 data.es data.hs data.op data.ss data.su data.p1 data.p2 data.p3 data.p4 " data() { cat dataNoBlanks3.csv \ | gawk -F, 'BEGIN {FS=OFS=","} {print $1,$5,$6,$7,$10,$11,$13,$14,$15,$16,$17,$18,$19,$20,$22,$23,$24}' > data.all cat dataNoBlanks3.csv \ | gawk -F, 'BEGIN {FS=OFS=","} {print $1,$5,$6,$7,$10,$11,$13,$14,$15,$16,$17,$18,$19,$20,$22,$23,$24}' \ | gawk -F, ' NR==1 { print $0 >"data.p1"; print $0 >"data.p2"; print $0 >"data.p3"; print $0 >"data.p4"; next } $1 == "X1" || $1 == "X12" || $1 == "X2" || $1 == "X4" || $1=="X5" || $1=="X8" {print $0 >> "data.p1"; next} $1 == "X10" || $1 == "X11" || $1 == "X3" || $1 == "X6" {print $0 >> "data.p2"; next} $1 == "X7" {print $0 >> "data.p3"; next} $1 == "X9" {print $0 >> "data.p4"; next} {print "?? " $0 } ' cat dataNoBlanks3.csv \ | gawk -F, 'BEGIN {FS=OFS=","} {print $1,$5,$6,$7,$10,$11,$13,$14,$15,$16,$17,$18,$19,$20,$22,$23,$24}' \ | gawk -F, ' NR==1 { print $0 >"data.es"; print $0 >"data.hs"; print $0 >"data.op"; print $0 >"data.ss"; print $0 >"data.su"; next } $1 == "X10" || $1 == "X5" {print $0 >> "data.es"; next} $1 == "X7" || $1 == "X9" {print $0 >> "data.hs"; next} $1 == "X11" || $1 == "X6" || $1 == "X8" {print $0 >> "data.op"; next} $1 == "X1" || $1 == "X2" || $1 == "X3" {print $0 >> "data.ss"; next} $1 == "X12" || $1 == "X4" {print $0 >> "data.su"; next} {print "?? " $0 } ' cat dataNoBlanks3.csv \ | gawk -F, 'BEGIN {FS=OFS=","} {print $1,$5,$6,$7,$10,$11,$13,$14,$15,$16,$17,$18,$19,$20,$22,$23,$24}' \ | gawk -F, ' NR==1 { print $0 >"data.eo2"; print $0 >"data.xf3"; print $0 >"Data.go4"; print $0 >"data.gs1"; next } $1 == "X1" || $1 == "X4" || $1=="X5" || $1 == "X7" || $1 == "X10" || $1=="X12" {print $0 >> "data.eo2"; next} $1 == "X2" || $1 == "X3" || $1 == "X8" {print $0 >> "data.xf3"; next} $1 == "X6" || $1 == "X11" {print $0 >> "data.go4"; next} $1 == "X9" {print $0 >> "data.gs1"; next} {print "?? " $0 } ' cat dataNoBlanks3.csv \ | gawk -F, 'function one() {return int(rand()*5) + 1 } BEGIN {FS=OFS=","; srand()} NR==1 {print $1,$5,$6,$7,$10,$11,$13,$14,$15,$16,$17,$18,$19,$20,$22,$23,$24} END {N=500; for(i=1;i<=500;i++) print "all",one(), one(),one(),one(),one(),one(),one(),one(),one(),one(),one(),one(),one(),one(),one(),one(),one()} ' > data.rand } cdfs() { for f in data.all $Files do gawk -F, 'NF > 15 {print}' $f | cut -d, -f 2- > $f.tmp mv $f.tmp $f blabln ":: $f" silap -w cdfs.$f $f done pwd ls -lsa cdfs.* } logs1() { silap -n 500 -V a $All | gawk '{print "a,"$0}' | tee $All.log silap -n 500 -V r data.rand | gawk '{print "r,"$0}' | tee data.rand.log silap -n 500 -V 1 data.gs1 | gawk '{print "1,"$0}' | tee data.gs1.log silap -n 500 -V 2 data.eo2 | gawk '{print "2,"$0}' | tee data.eo2.log silap -n 500 -V 3 data.xf3 | gawk '{print "3,"$0}' | tee data.xf3.log silap -n 500 -V 4 data.go4 | gawk '{print "4,"$0}' | tee data.go4.log silap -e $All | gawk '{print "o,"$0}' | tee data.zorig.log } logs2() { silap -n 500 -V e data.es | gawk '{print "e,"$0}' | tee data.es.log silap -n 500 -V h data.hs | gawk '{print "h,"$0}' | tee data.hs.log silap -n 500 -V o data.op | gawk '{print "o,"$0}' | tee data.op.log silap -n 500 -V s data.ss | gawk '{print "s,"$0}' | tee data.ss.log silap -n 500 -V u data.su | gawk '{print "u,"$0}' | tee data.su.log #silap -V c -r $Here/cdf.km1FlightSw | gawk 'NR < 90{print "c,"$0}' | tee data.km1FlightSW.log } logs3() { silap -n 500 -V w data.p1 | gawk '{print "w,"$0}' | tee data.p1.log silap -n 500 -V x data.p2 | gawk '{print "x,"$0}' | tee data.p2.log silap -n 500 -V y data.p3 | gawk '{print "y,"$0}' | tee data.p3.log silap -n 500 -V z data.p4 | gawk '{print "z,"$0}' | tee data.p4.log #silap -V c -r $Here/cdf.km1FlightSw | gawk 'NR < 90{print "c,"$0}' | tee data.km1FlightSW.log } dists1() { rm *.dist for i in $All $All data.gs1 data.eo2 data.xf3 data.go4 data.zorig do gawk -F, 'function trim(s) { sub(/^ */,"",s); sub(/ *$/,"",s); return s } {$2= trim($2)} BEGIN {com="sort -t, -n +0 "; OFS=","} $NF ~ /\*/ && Pass==1 { Order[++Order[0]]=$2 ; Name[Order[0]]=trim($3); Redro[$2]=Order[0]} $NF ~ /\*/ && Pass==2 { Thing[$2]=$4 } END {system("rm names"); for(i=1;i<=Order[0];i++) { print "\"" Name[i] "\" " i ",\\">> "names" print (Order[i] in Thing ? Thing[Order[i]] : 0 )}} #,(Order[i] in Thing ? Thing[Order[i]] : 0 ) } ' Pass=1 $All.log Pass=2 $i.log \ | sed 's/\%//' > $i.log.dist done paste *.dist | cat -n > dist.plot $gnuplot <> "names" print (Order[i] in Thing ? Thing[Order[i]] : 0 )}} #,(Order[i] in Thing ? Thing[Order[i]] : 0 ) } ' Pass=1 $All.log Pass=2 $i.log \ | sed 's/\%//' > $i.log.dist done paste *.dist | cat -n > dist.plot $gnuplot <> "names" print (Order[i] in Thing ? Thing[Order[i]] : 0 )}} #,(Order[i] in Thing ? Thing[Order[i]] : 0 ) } ' Pass=1 $All.log Pass=2 $i.log \ | sed 's/\%//' > $i.log.dist done pwd paste *.dist | cat -n > dist.plot cat dist.plot $gnuplot < $i.er done } ceplot() { $gnuplot <