1

I am trying to convert CSV file into XLSX.

I have done successfully in XLS before but when trying to do in XLSX , I keep getting errors.

This is sample script I am trying to execute.

https://github.com/jmcnamara/excel-writer-xlsx/blob/master/examples/a_simple.pl

I have included all these Lib in my script :- !/usr/bin/perl -w

use lib qw(/Scripts/perl/excel-writer-xlsx-master/lib);

use lib qw(/Scripts/perl/File-Temp-0.19/lib);

use lib qw(/Scripts/perl/Archive-Zip-1.30/lib);

use lib qw(/Scripts/perl/IO-1.25/lib);

use lib qw(/Scripts/perl/Compress-Raw-Zlib-2.069/lib);

Error :- Can't locate loadable object for module Compress::Raw::Zlib in @INC Compilation failed in require /Archive-Zip-1.30/lib/Archive/Zip.pm line 12

XLS working successfully with this package: Spreadsheet-WriteExcel-2.40

Perl XLSX Module downloaded from

http://search.cpan.org/dist/Excel-Writer-XLSX/lib/Excel/Writer/XLSX.pm

2
  • 1
    I have highlighted the Error . Commented Aug 18, 2016 at 17:24
  • 2
    It looks like you've just unpacked the tar files downloaded from CPAN. That's not how you install Perl modules. In particular, modules like Compress::Raw::Zlib that are written in C need to be compiled during installation. Have a read of: How to install CPAN modules. Commented Aug 18, 2016 at 22:19

2 Answers 2

2

The paths you're specifying in these use lib statements look wrong. Make sure that you have actually installed these modules (i.e, using the cpan or cpanm tools). Simply unpacking the tarballs from the CPAN web site is not sufficient, and will not work, as some of these modules must be compiled to function.

Once you've installed these modules correctly, they should be available on the default Perl @INC path, and you will not need to use any extra use lib lines.

Sign up to request clarification or add additional context in comments.

Comments

0

You can try with a python script which convert any ff - flat file to required file format. csv2xls.py Ref link: https://pypi.python.org/pypi/csv2xls/0.4

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.