#!/bin/csh

# Last modified: January 31st, 1996

set grep_tmp_file = "./.grep"
set simlogfile = $1

#set datfile = "./dat.file"

#------------------------------------------------------------------------
# extract the datafiles
#------------------------------------------------------------------------

\rm $grep_tmp_file 

  foreach findkey ( ` cut -d" " -f1 $simlogfile | sort | uniq`)
     if ( $findkey != "#") then
        grep "^"$findkey" " $simlogfile >! $grep_tmp_file
        cut -d" " -f2,3 $grep_tmp_file > $findkey".dat"

#cut -d" " -f2,3 $grep_tmp_file > $datfile
#cat $findkey".dat" | awk '{printf" %d %d\n", $1/1000, $2}' >!$datfile

     endif
  end

\rm $grep_tmp_file











