简体   繁体   中英

How to get cell formats from XLSX files in Perl?

I am able to find $cell->get_format() or $cell->format _hash in .xls files parser but not for xlsx format. I am also open to use any XLSX parser for reading the spreadsheet. Basically I am copying one spreadsheet to another preserving the format.

I am new to the Perl, Please bear up with me if it's very basic. The below code works fine copying in excel value to another. I am having trouble copying the format. I need to copy the format value from the reading file and then assign it to writing cell- self is the variable need to change.

The question I have asked Earlier How to copy the format of the .xlsx cell using "Excel::Writer::XLSX" reader to the copied cell using "Spreadsheet::WriteExcel" writer? And I am open to any other XLSX parser in case this is not the right to copy the format of the cell.

These modules cannot modify spreadsheets in place, so you need a reader and a writer. To read an XLSX file, use Spreadsheet::ParseXLSX which implements the same methods as Spreadsheet::ParseExcel but parses XLSX files, so its cells also have get_format which returns the properties listed here . To write a new spreadsheet use Excel::Writer::XLSX , which implements the same methods as Spreadsheet::WriteExcel but creates XLSX files. You would add formats to such a new sheet as described here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM