I am new to perl and I have just started using the module Spreadsheet::ParseExcel. I do not want to write anything to the Excel sheet that I am using. The script should basically run through the Excel sheet and print the values row by row. I have around 250 rows and 3 columns. So output has to be something like :
Glendale Academy Mark 40%
Glendale Academy Tom 60%
.....
.....
.....
On the terminal.
I am using this Windows ( Should I consider Win32::OLE
and Win32::OLE::Const 'Microsoft Excel'
. ( What should be the format of the sheet ? .xls , .xlsx , .csv )
Here is what I have done so far:
After going through a lot of scripts on this website, I thought using 'Split' would be the easiest.That was super easy now that it is excel I am not able to understand how to go with this.
My script so far is this;
use strict;
use warnings;
use Spreadsheet::ParseExcel;
my $reader = Excel::Write::XLSX->new(); # I am sure something is wrong here
my $workbook = Spreadsheet::WriteExcel->new('Draft.xls');
#my $workbook = $reader->read_file( 'Draft.xlsx' );
if ( !defined $workbook ) {
die $reader->error(), "\n";
}
for my $worksheet ( $workbook->worksheets() ) {
my $sheetname = $worksheet->name();
print "Sheet = $sheetname\n";
while ( my $row = $worksheet->next_row() ) {
while ( my $cell = $row->next_cell() ) {
my $row = $cell->row();
my $col = $cell->col();
my $value = $cell->value();
print " Cell ($row, $col) = $value\n";
}
}
}
Any kind of help would be greatly appreciated guys; Stuck for like a week now....