PERL: Split Excel Workbook to Indiv Excel files

Hi,

I am trying to find a way to read an excel work book with multiple worksheets.
And write each worksheet into a new excel file using perl. My environment is Unix.

For example: I have an excel workbook TEST.xls and it has Sheet1, Sheet2, Sheet3 worksheets. I would like to create Sheet1.xls, Sheet2.xls .....

Any ideas are deeply appreciated.

Thanks for all your time.

if you have Python, you can install excel module, eg PyExcelarator

import pyExcelerator,os
book = pyExcelerator.parse_xls("test.xls")
curpath = os.path.dirname(__file__) 
for items in book:
    sheetname=items[0]
    contents=items[1]
    workbook = pyExcelerator.Workbook()
    worksheet = workbook.add_sheet("Sheet 1")     
    for key,value in contents.iteritems():
        print "key ",key, " value: ",value
        worksheet.write(key[0],key[1], value)
        workbook.save(os.path.join(curpath, sheetname+".xls"))

you can search CPAN for Perl excel modules too.

Thank you for the response. I dont have python installed.

I checked for the excel modules on CPAN website. I managed to find the modules.

But, I am having trouble putting it together.

use strict;
use Spreadsheet::ParseExcel;
my $Excel = new Spreadsheet::ParseExcel;
my $Book = $Excel->Parse(Test.xls);
$WkS = $Book->{Worksheet}

I got to this point, where I can read the worksheet. How can I write the worksheet to a new excel file? Any ideas please.

Thank you.