Prajakta
Prajakta

Reputation: 27

Unix Script Convert CSV into XLSX

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

Upvotes: 1

Views: 5234

Answers (2)

Venugopal
Venugopal

Reputation: 29

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

Upvotes: 0

user149341
user149341

Reputation:

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.

Upvotes: 2

Related Questions