#! /bin/bash # first handle setting up files for the experiment considering all of the estimates gawk 'BEGIN{FS=OFS=","}{if (($1=="DI")||($1=="Cassini")||($1=="mer")||($1=="DS1")||($1=="mro")||($1=="mpf")||($1=="sirtf")||($1=="odyssey")||($1=="Genesis")){print $0,"F"}else{print $0,"G"}}' 2CEE_raw_results.csv > assign.tmp grep Flight assign.tmp | grep -v Ground | grep -v All | gawk 'BEGIN{FS=OFS=","}{if ($5=="F"){print $1,$2,$3,$4}}' > flight.tmp grep Ground assign.tmp | grep -v Flight | grep -v All | gawk 'BEGIN{FS=OFS=","}{if ($5=="G"){print $1,$2,$3,$4}}' > ground.tmp grep All 2CEE_raw_results.csv > all.tmp grep None-User-None-Normal 2CEE_raw_results.csv > none.tmp { cat none.tmp cat all.tmp cat flight.tmp cat ground.tmp cat SCAT_estimates.csv } > 1.tmp # now to replace Flight and Ground with ForG in the last file: sed -e 's/SeawindsGround/Seawinds/g' 1.tmp | sed -e 's/Flight/ForG/g' | sed -e 's/Ground/ForG/g' | sed -e 's/Seawinds/SeawindsGround/g' > 2CEE_results.csv # next consider only flight project estimates so we can include the FSWCM estimates gawk 'BEGIN{FS=OFS=","}{if (($1=="DI")||($1=="Cassini")||($1=="mer")||($1=="DS1")||($1=="mro")||($1=="mpf")||($1=="sirtf")||($1=="odyssey")||($1=="Genesis")){print $0}}' 2CEE_raw_results.csv > flight_projects.tmp grep Flight flight_projects.tmp | grep -v Ground | grep -v All | gawk 'BEGIN{FS=OFS=","}{print $1,$2,$3,$4}' > flight.tmp grep All flight_projects.tmp > all.tmp grep None-User-None-Normal flight_projects.tmp > none.tmp { cat none.tmp cat all.tmp cat flight.tmp cat SCAT_estimates.csv | gawk 'BEGIN{FS=OFS=","}{if (($1=="DI")||($1=="Cassini")||($1=="mer")||($1=="DS1")||($1=="mro")||($1=="mpf")||($1=="sirtf")||($1=="odyssey")||($1=="Genesis")){print $0}}' cat FSWCM_estimates.csv } > 2CEE_flight.csv # next consider only ground project estimates so we can include the FSWCM estimates gawk 'BEGIN{FS=OFS=","}{if (($1=="DI")||($1=="Cassini")||($1=="mer")||($1=="DS1")||($1=="mro")||($1=="mpf")||($1=="sirtf")||($1=="odyssey")||($1=="Genesis")){sum++}else{print $0}}' 2CEE_raw_results.csv > ground_projects.tmp grep Ground ground_projects.tmp | grep -v Flight | grep -v All | gawk 'BEGIN{FS=OFS=","}{print $1,$2,$3,$4}' > ground.tmp grep All ground_projects.tmp > all.tmp grep None-User-None-Normal ground_projects.tmp > none.tmp { cat none.tmp cat all.tmp cat ground.tmp cat SCAT_estimates.csv | gawk 'BEGIN{FS=OFS=","}{if (($1=="DI")||($1=="Cassini")||($1=="mer")||($1=="DS1")||($1=="mro")||($1=="mpf")||($1=="sirtf")||($1=="odyssey")||($1=="Genesis")){sum++}else{print $0}}' } > 2CEE_ground.csv # remove tmp files rm assign.tmp rm none.tmp rm all.tmp rm flight.tmp rm ground.tmp rm 1.tmp rm flight_projects.tmp rm ground_projects.tmp