简体   繁体   English

perl脚本以使用cpan模块读取Excel文件

[英]perl script to read an excel file using cpan modules

I am writing a perl script to read data from an excel file. 我正在编写一个Perl脚本以从Excel文件中读取数据。 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. 该脚本是在Unix环境中编写的,并在服务器上运行,而excel文件在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. 输出发出警告,提示Use of uninitialized value in say at..... line 10没有其他输出正在打印。 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. 我只是编写了一个示例代码来读取工作表1中的A1单元值。后来,我需要编写一个逻辑来读取特定值。 For right now, need to fix the error to read and print the excel cell values. 目前,需要修复错误以读取和打印excel单元格值。 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. 我使用samba将Unix磁盘映射到Windows网络驱动器。 But now, I get a different error which says : Parser for XLSX is not installed at.. Can someone help me to resolve it. 但是现在,我收到一个不同的错误,该错误Parser for XLSX is not installed at..有人可以帮助我解决它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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