Reading xls file thru perl in Linux and create HTML

#!/usr/bin/perl
use Fcntl; #The Module
use Spreadsheet::ParseExcel;

unlink (“Trunk_page.html”);
sleep 2;
my $oExcel = new Spreadsheet::ParseExcel;
my $oBook = $oExcel->Parse(“E:/File_Report.xls”);

print “content-type: text/html \n\n”; #The header
sysopen (HTML, ‘Trunk_page.html’, O_RDWR|O_EXCL|O_CREAT, 0755);
printf HTML “\n”;
printf HTML “\n”;
printf HTML “”;
printf HTML ” body {font-family: Times New Roman, verdana;”;
printf HTML ” color: black; } “;
printf HTML ” t2 { color:blue } “;
printf HTML ” t1 { color:red } “;
printf HTML ” t3 { size:’1′ } “;
printf HTML “\n”;
printf HTML “

“;
printf HTML “This email is best read in HTML
“;
printf HTML “


“;
printf HTML “

“;
printf HTML “Here is trunk (Cpp, Obj, Exe, Dll and Lib file) file details with date after Nightly Build run.“;
printf HTML “


“;

#my $Tot_Rows= $Sheet->UsedRange->Rows->{‘Count’};
printf HTML “

“;
my($iR, $iC, $oWkS, $oWkC);
$oWkS = $oBook->{Worksheet}[0];
# Performance Table
print $oWkS->{MaxCol};

#for(my $iR = $oWkS->{MinRow} ; $iR {MaxRow} ; $iR++)
#for($iR = 0 ; $iR {MaxRow})
{
printf HTML “

“;
}

printf HTML “\n”;
#$oBook->close();
close (HTML);

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

    “;
    #for($iC = 0 ; $iC {MaxCol})
    {
    $oWkC = $oWkS->{Cells}[$row][$col];
    printf HTML “%s”,$oWkC->Value,if($oWkC);
    printf HTML “
    “;
    }
    printf HTML “