diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2012-09-03 20:06:47 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2012-09-03 20:06:47 -0400 |
commit | a2747ec5990fb5ee6fde74767d8fd44f838b5346 (patch) | |
tree | 5386643fa899b7ff8cf4ccc0df424c11ca33bd5b | |
parent | e34d6c4c20c413c49ea282e5f64e265d4e5860a7 (diff) | |
download | GradeBook-a2747ec5990fb5ee6fde74767d8fd44f838b5346.tar.gz GradeBook-a2747ec5990fb5ee6fde74767d8fd44f838b5346.zip |
split out first name and initial, print with join statement
-rwxr-xr-x | banner2csv.pl | 17 |
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); } |