#!/usr/bin/perl
open(DAT, $ARGV[0]);
$citecount=0; $papercount=0; $h=0;
while ($line=<DAT>) {
while ($line =~ m/Cited by (\d+)/g) {
   $citecount+=$1;
   $papercount+=1;
   if ($1 >= $papercount) { $h=$papercount; }
   #print $1,"\n";
}
}
print "No. papers=$papercount\n";
print "total cites=$citecount\n";
print "h-index=$h\n";
print "avg cites per paper=",$citecount/$papercount,"\n";

