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

Suppose I have the following spreadsheet that I can parse in perl, which looks like this:

enter image description here

I want to insert a column between Column1 and Column2. So, the end result is as follows:

enter image description here

It doesn't seem like Spreadsheet-WriteExcel has an installed method.

Does anyone know an easy way to do this in Perl?

Thank you very much in advance!

+4
source share
1 answer

The only (*) thing that Spreadsheet::WriteExcel can do is write spreadsheets. It does not have the means to read an existing spreadsheet. Using it to modify an existing spreadsheet will include first reading it using another method (for example, Spreadsheet::ParseExcel ), and then creating a new data table the way you want it. Please note: if you try this, you will lose macros, graphs, and any other function that Spreadsheet::WriteExcel does not support.

The documentation for Spreadsheet::WriteExcel uses many alternatives. See Sections WRITING EXCEL FILES and MODIFYING AND REWRITING EXCEL FILES . Win32::OLE , for example, gives you full access to the internal Excel files with all the power and ease of use that you expect from the Microsoft API. I will leave it to you to judge whether any of these approaches is suitable as “easy”.

(*) - I do not mean that it is bad. The Perl module, which can write spreadsheets, is pretty cool.

+4
source

All Articles