Skip to content
Browse files

"Single Sta" bugfix. Starting lifetime report.

  • Loading branch information...
1 parent 21fc30d commit 2be3a7bf8775a19180f8a0048738d0e471abba58 @jhannah committed Aug 30, 2012
Showing with 20 additions and 3 deletions.
  1. +19 −0 lifetime.pl
  2. +1 −3 load_db.pl
View
19 lifetime.pl
@@ -0,0 +1,19 @@
+use strict;
+use 5.10.0;
+use DBI;
+
+my $dbh = DBI->connect("dbi:SQLite:dbname=enps.sqlite","","");
+
+# my ($place, $lname, $fname, $uspsa, $class, $division, $pf, $lady, $for, $age, $points, $stgperc) = @l;
+my $strsql = "select lname, fname, sum(points) points from results group by lname, fname order by sum(points) desc";
+my $sth = $dbh->prepare($strsql);
+$sth->execute;
+while (my $href = $sth->fetchrow_hashref) {
+ say "$href->{lname}, $href->{fname} $href->{points}";
+}
+$sth->finish;
+
+
+$dbh->disconnect;
+
+
View
4 load_db.pl
@@ -1,13 +1,11 @@
use strict;
use 5.10.0;
-
use DBI;
my $dbh = DBI->connect("dbi:SQLite:dbname=enps.sqlite","","");
my $strsql = "insert into results (event, stat_type, year, month, place, lname, fname, uspsa, class, division, pf, lady, mil, law, for, age, points, stgperc) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
my $sth = $dbh->prepare($strsql);
-
my @files = `find data -name "*.txt"`;
foreach my $f (@files) {
chomp $f;
@@ -52,7 +50,7 @@
}
# "Single Stack" gets split
- if ($l[-10] eq "Single" && $l[-9] eq "Stack") {
+ if ($l[-10] eq "Single" && $l[-9] =~ /^Sta/) {
$l[-10] = "Single Stack";
splice @l, -9, 1;
}

0 comments on commit 2be3a7b

Please sign in to comment.
Something went wrong with that request. Please try again.