perldoc > Spreadsheet::XLSX

πŸ“› NAME

Spreadsheet::XLSX - Perl extension for reading MS Excel 2007 files

πŸš€ Quick Reference

Use CaseCommandDescription
πŸ“„ Open an .xlsx filemy $excel = Spreadsheet::XLSX->new('file.xlsx');⏺️ Load an Excel 2007 workbook
πŸ”€ Specify encoding conversionText::Iconv->new("utf-8","windows-1251")🌐 Pass a converter object to handle character encoding
πŸ“‹ Iterate over all sheetsforeach my $sheet (@{$excel->{Worksheet}})πŸ“‘ Loop through each worksheet
πŸ” Iterate rows and cellsforeach my $row ($min..$max) { foreach my $col ($min..$max) }πŸ”’ Access cell values by row/column coordinates
πŸ“ Read cell value$cell->{Val}πŸ“₯ Retrieve the cell's content

πŸ“– SYNOPSIS

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;

my $excel = Spreadsheet::XLSX->new('test.xlsx', $converter);

foreach my $sheet (@{$excel->{Worksheet}}) {

    printf("Sheet: %s\n", $sheet->{Name});

    $sheet->{MaxRow} ||= $sheet->{MinRow};

    foreach my $row ($sheet->{MinRow} .. $sheet->{MaxRow}) {

        $sheet->{MaxCol} ||= $sheet->{MinCol};

        foreach my $col ($sheet->{MinCol} ..  $sheet->{MaxCol}) {

            my $cell = $sheet->{Cells}[$row][$col];

            if ($cell) {
                printf("( %s , %s ) => %s\n", $row, $col, $cell->{Val});
            }

        }

    }

}

πŸ“ DESCRIPTION

This module is a (quick and dirty) emulation of Spreadsheet::ParseExcel for Excel 2007 (.xlsx) file format. It supports styles and many of Excel's quirks, but not all. It populates the classes from Spreadsheet::ParseExcel for interoperability; including Workbook, Worksheet, and Cell.

πŸ”— SEE ALSO

πŸ‘€ AUTHOR

Dmitry Ovsyanko, <do AT eludia.ru>, http://eludia.ru/wiki/

Patches by:

πŸ™ ACKNOWLEDGEMENTS

Thanks to TrackVia Inc. (http://www.trackvia.com) for paying for Rob Polocz working time.

πŸ“„ COPYRIGHT AND LICENSE

Copyright (C) 2008 by Dmitry Ovsyanko

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

Spreadsheet::XLSX
πŸ“› NAME πŸš€ Quick Reference πŸ“– SYNOPSIS πŸ“ DESCRIPTION πŸ”— SEE ALSO πŸ‘€ AUTHOR πŸ™ ACKNOWLEDGEMENTS πŸ“„ COPYRIGHT AND LICENSE

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-16 10:20 @216.73.216.87
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^