#!/bin/csh -f
#
# exall - extract from all files a particular column
#   Useful only for prefetch/no prefetch directories.
#   Not useful for noncached or writing directories.
# 
# usage
#  exall col name dir...
# where col is the column number to extract, name is the name of the
# column (eg total, or tread), and dir... is a list of directories 
# to do it in. It extracts non-prefetched files separately from
# prefetched files, and also extracts the improvement data.
#

if ($#argv < 3) then
	   echo usage: exall col name dir...
	   exit
endif

set col=$1
set name=$2
shift;shift

set top=`pwd`
foreach dir ($*)
	   cd $dir

# the old way
#	   extract $col n.*.data-a > $name.n
#	   extract $col y.*.data-a > $name.y

	   extract $col *.n.00.*.data-a > $name.n
	   extract $col *.e.00.*.data-a > $name.y
	   extract -i $col *.e.00.*.data-a > $name.i

	   cd $top
end
