aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbanner2csv.pl17
1 files changed, 11 insertions, 6 deletions
diff --git a/banner2csv.pl b/banner2csv.pl
index bb37436..53a5959 100755
--- a/banner2csv.pl
+++ b/banner2csv.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# FILE: "/home/evmik/src/my_src/GradeBook/html_table2csv.pl"
-# LAST MODIFICATION: "Thu, 30 Aug 2012 23:48:31 -0400 (evmik)"
+# FILE: "/home/evmik/src/my_src/GradeBook/banner2csv.pl"
+# LAST MODIFICATION: "Mon, 03 Sep 2012 20:06:38 -0400 (evmik)"
# (C) 2012 by Eugeniy Mikhailov, <evgmik@gmail.com>
#use HTML::Entities;
@@ -101,13 +101,18 @@ sub spantag_end_handler
}
-# Shorthand...top level rows() method assumes the first table found in
-# the document if no arguments are supplied.
+my $first_time = 1;
+# assumes that we were able to chose a proper table before
+# and really get the proper one
foreach $row ($te->rows) {
#student name
$aparser->parse(@$row[1]);
$name=$parsed_text;
+ ($lname, $fname)=split(',', $name);
+ $fname =~ s/^ //;
+
+
#student id
#print @$row[2];
$spanparser->parse(@$row[2]);
@@ -119,7 +124,7 @@ foreach $row ($te->rows) {
$email =~ s/mailto://;
- print $name, "," , $sid, "," , $email;
- print "\n";
+ if ($first_time) {$first_time = 0;} else {print "\n";}
+ print join(',', $fname, $lname, $sid, $email);
}