#! /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" " -f1 -s xx00 > temp.0
#while ( $ctr < $no_file ) 
#@ ctr = $ctr + 1
#echo $ctr
#if ($ctr < 10 ) then
#cut -d" " -f1 -s xx0$ctr > temp.$ctr
#else
#cut -d" " -f1 -s xx$ctr > temp.$ctr
#endif
#cat temp.$ctr >> temp.0
#end
#sort -f -i < temp.0 | uniq -c | sort -r -t" " -n > location.stat.past
##
#cumulative statistics
#
set meso = 'mesonet'
set cam = 'cameras'
set weather = 'weather.html'
set fore = 'models.html'
set dep = 'department.html'
set link = 'links.html'
set oly = 'olympics'
set mes_count = ` grep -c $meso $log ` 
set cam_count = ` grep -c $cam $log ` 
set wea_count = ` grep -c $weather $log  ` 
set for_count = ` grep -c $fore $log  ` 
set dep_count = ` grep -c $dep $log ` 
set lin_count = ` grep -c $link $log `
set oly_count = ` grep -c $oly $log `
echo $mes_count $cam_count $wea_count $for_count $dep_count $lin_count $oly_count > cum.type.past
