#! /bin/csh
cd /home/meteor/x/class/jhorel/web_log
# must be logged onto meteor
#
# input log file
set log = $1
#
# by location
#
#set total = ` wc -l < $log `
#@ no_file = $total / 75000  
#echo $no_file $total
#@ nm1 = $no_file - 1
#rm -f xx*
#rm -f temp.*
#set ct = 1
#set string = ""
#while  ( $ct <= $no_file )
#@ no = 75000 * $ct
#set string = "$string $no"
#@ ct = $ct + 1
#end
# 
#echo $no_file
#csplit -k -s $log  $string
set ctr = 0
cut -d" " -f7 -s xx00 > categ.0
set no_file = 84
while ( $ctr < $no_file ) 
@ ctr = $ctr + 1
echo $ctr
if ($ctr < 10 ) then
cut -d" " -f7 -s xx0$ctr > cat.$ctr
else
cut -d" " -f7 -s xx$ctr > cat.$ctr
endif
cat cat.$ctr >> categ.0
end
sort -f -i < categ.0 | uniq -c | sort -r -t" " -n > categ.stat.past
