简体   繁体   中英

perl script to read an excel file using cpan modules

I am writing a perl script to read data from an excel file. The script is being written in an unix environment and run on the server, whereas the excel file is available on my Desktop in Windows.

#!/usr/bin/perl
use strict;
use warnings;
use feature 'say';


use Spreadsheet::Read;

my $workbook = ReadData ("C:/Users/tej/Desktop/Work.xlsx");
say $workbook->[1]{A1};

The output gives out a warning saying Use of uninitialized value in say at..... line 10 And there is no other output being printed. I just wrote a sample code to read the A1 cell value from sheet 1. Later, I need to write a logic to read particular values. For right now, need to fix the error to read and print the excel cell values. Appreciate any help. :)

I fixed the issue. It was about file was not being accessed. I used samba to Map unix disk to Windows Network Drive. But now, I get a different error which says : Parser for XLSX is not installed at.. Can someone help me to resolve it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM