How can I combine multiple Excel worksheets into a single workbook using Perl? - perl

I am producing 5 different Excel worksheets (.csv file) using Perl. I want to combine all these as one file (Excel workbook) with 5 different worksheets rather then have 5 seperate files.
Don't know if this is possible? IF anyone have any idea on how to do this that would be greatly appreciated.

You should use the CPAN Module Spreadsheet::WriteExcel.
It can write different worksheets. At the end there is an example that takes a tab.txt file, and write it to a spreadsheet. If you modify this example to take your five files, and each time create a new worksheet in your spreadsheet, your problem is solved.

Related

Extract Data in Sprinklr

I have list of 600 companies in an excel file. I want to extract data for each of them in .csv file.
I have started by searching for each company separately and downloading the excel and saving it. It's very time consuming.
Can someone help me with an easier method to solve this.

how to write to a single file in multi threading concept of spring batch

I am reading from a database and writing to a file for that scenario I am using multi threading concept. In a flow I declared 4 steps and those 4 steps are working parellelly but in this scenario I can able to write the result to 4 different csv files.
My requirement is to write the 4 threads data to a single file. If I give same file name in 4 places will it work or it overrides the data. please suggest me.
Write 4 different files and create an extra step to concatenate previously created pieces in one big file (a SystemCommandTasklet might fit)

How to insert a column inbetween other columns (Perl Spreadsheet::WriteExcel)

Lets say I have the following spreadsheet that I can parse in perl which looks like this:
I want to insert a column between Column1 and Column2. So end result looks like this:
It doesn't look like there is a set method for this in Spreadsheet-WriteExcel.
Does anyone know an easy way of doing this in Perl?
Many Thanks in advance!
The only(*) thing that Spreadsheet::WriteExcel can do is write spreadsheets. It doesn't have any facilities for reading an existing spreadsheet. Using it to modify an existing spreadsheet would involve first reading it with some other method (like Spreadsheet::ParseExcel) and then writing a brand new spreadsheet with the data the way you want it. Note that if you try this, you will lose macros, graphs, and any other feature that Spreadsheet::WriteExcel doesn't support.
The documentation for Spreadsheet::WriteExcel goes over a lot of the alternatives. See the WRITING EXCEL FILES and MODIFYING AND REWRITING EXCEL FILES sections. Win32::OLE for instance, gives you full access to Excel's internals with all the power and ease-of-use you'd expect from a Microsoft API. I'll leave it to you to judge whether any of these approaches qualify as "easy".
(*) - I don't mean that in a bad way. A Perl module that can write spreadsheets is pretty freaking cool.

perl module for writing excel2007 workbook

I have a huge report coming out of a tool from which i extract the some important data and write a excel file. Till now i used the module Spreadsheet::WriteExcel, but it crashed when the number of rows exceed 65535. Is there any other module which supports generating excel for huge data? I checked in CPAN, found modules for reading excel2007 files but couldnt find one for writing. I am not writing a csv because, i want to generate multiple worksheets in the excel file.
Excel::Writer::XLSX is an API compatible replacement for Spreadsheet::WriteExcel that supports the Excel 2007 xlsx format and the increased row/column limits.
If you check the bugs link on the Spreadsheet::WriteExcel cpan site, you will notice there is an defect which is open for more than 11 months for this exact issue.
Bug ID: 54902
That said, can't you instead try writing in chunks of 65536 rows in each spreadsheet and later collate it?

Automate Spreadsheet Transformations

Every month I process a vendor's MS Excel spreadsheet for my work. I have to remove columns, rename columns, re-format columns, and then email the resulting spreadsheet to colleagues.
Is there a way, in Excel or Numbers or programmatically, to automate this extremely repetitive process?
Thanks,
Sergio
Excel for Mac supports Applescript so you could script the process. RealBasic can automate Excel. Excel for Mac used (5+ years ago) to ship with a reduced version of it. Don't know if it still does.
Applescript support in iWork Numbers is rather good so if you have Numbers I would suggest importing into Numbers and running the script there.