SetDirectory["/home/helms/raid/ctf/jobs/2007-09-21"];
(*rawData=Import["!cat ./orb/orb*.out","Table"];outFile="orb.all"*)
(*rawData=Import["!cat ./eta/eta*.out","Table"];outFile="eta.all"*)
rawData=Import["!cat ./cbar*.out","Table"];outFile="cbar.all"

trimData=Select[rawData,(#[[1]]=="D")&];
corrections=Union[trimData[[All,3]]]
(*keyVals=Union[trimData[[All,11;;12]]]*)
keyVals=Union[trimData[[All,11]]]

emit=Table[Select[trimData,(#[[3]]==corrections[[iCor]]&&#[[11]]==keyVals[[iKey]])&][[All,4]],{iKey,1,Length[keyVals]},{iCor,1,Length[corrections]}];
TableForm[Map[Length,emit,{2}],TableHeadings->{keyVals,corrections}]
emitTable=Prepend[Map[Quantile[#,{.5,.95}]&,emit,{2}]//Map[Flatten,#]&//Transpose,keyVals]//Transpose;
TableForm[emitTable[[All,2;;]],TableHeadings->{keyVals,Sort[Join[corrections,corrections]]}]
Export[outFile,emitTable,"Table"]