CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
import data from Excel to terminal in perl

 



vikasmetla
Novice

May 30, 2014, 4:27 AM

Post #1 of 2 (16063 views)
import data from Excel to terminal in perl Can't Post

hi guys

i trying to import my excel data into my linux terminal but i getting "no data found in excel "how should i remove this and print my excel data into terminal...plz help me out of this error


Code
#!/usr/bin/perl 
use strict;
use Spreadsheet::ParseExcel;
#my $Filename ="/var/tmp/example1.xls";

my $parser =Spreadsheet::ParseExcel->new();
my $workbook = $parser->parse('example1.xlsx');
if(!defined $workbook)
{
die $parser->error(),".\n";
}

for my $worksheet($workbook->worksheets()){

my ($row_min,$row_max)=$worksheet->row_range();
my ($col_min,$col_max)=$worksheet->col_range();

for my $row ($row_min .. $row_max) {
for my $col($col_min .. $col_max) {

my $cell=$worksheet->get_cell($row,$col);
next unless $cell;


Code



      
    


FishMonger
Veteran / Moderator

May 30, 2014, 8:47 AM

Post #2 of 2 (15974 views)
Re: [vikasmetla] import data from Excel to terminal in perl [In reply to] Can't Post

Did you read the module documentation?


Quote
DESCRIPTION

The Spreadsheet::ParseExcel module can be used to read information from Excel 95-2003 binary files.

The module cannot read files in the Excel 2007 Open XML XLSX format. See the Spreadsheet::XLSX module instead.


http://search.cpan.org/~dmow/Spreadsheet-XLSX-0.13-withoutworldwriteables/lib/Spreadsheet/XLSX.pm

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives