LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   converting .xlsx to .xls from bash (https://www.linuxquestions.org/questions/linux-newbie-8/converting-xlsx-to-xls-from-bash-911023/)

qrange 10-31-2011 03:06 AM

converting .xlsx to .xls from bash
 
I need to convert .xlsx to .xls from command line, can it be done?

thanks.

JJJCR 10-31-2011 04:02 AM

Quote:

Originally Posted by qrange (Post 4512299)
I need to convert .xlsx to .xls from command line, can it be done?

thanks.

hi qrange, what are you trying to do? .xlsx is an office 2007 to 2010 file name extension and .xls is office 2003 and other previous versions.

if you rename it the file might be unusable, why not open it on excel or open office and specify the file extension that you want.

conversion is not possible using command line only, you can rename the file using mv command but the file maybe corrupted.

qrange 10-31-2011 05:20 AM

nah, I need to parse it with perl.
I've found out there is a Spreadsheet::XLSX for that, so will try without pre-converting.

umamahesh142 01-22-2014 12:45 AM

I am trying to edit the xlsx files using perl in linux.

Is the Spreadsheet::XLSX works with linux in PERL ? If you have already used please suggest me the syntaxes and let me know if any packages has to be installed to use this.

I have used like below and ended up with errors.

Code:
/************************************/
#!/usr/bin/perl

use strict;
#use Text::Iconv;
# my $converter = Text::Iconv -> new ("utf-8", "windows-1251");

# Text::Iconv is not really required.
# This can be any object with the convert method. Or nothing.

use Spreadsheet::XLSX;

/************************************/
Error:
Can't locate Spreadsheet/XLSX.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at sample.pl line 10.


Thanks for your help.

qrange 01-23-2014 06:29 AM

i think error "Can't locate Spreadsheet/XLSX.pm"

means you haven't installed it properly. start CPAN and use 'install Spreadsheet::XLSX'
or use your package manager.

umamahesh142 01-23-2014 08:00 AM

Thank You. I will ask my admin to install the Spreadsheet::XLSX module. Mean-time I will work with xlsparser.


All times are GMT -5. The time now is 06:35 PM.