Spreadsheet::XLSX(3pm)

Spreadsheet::XLSX3pm

Perl extension for reading ms excel 2007 files.

Usage

    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});
                }
        
            }
        
        }
    
    }

Overview

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.

Acknowledgements

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

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 4 times.

  1. 6.0–8
  2. 9
  3. 10–11
  4. 12
  5. 13

Author

Dmitry Ovsyanko, <[email protected]>, http://eludia.ru/wiki/

Patches by:

        Steve Simms
        Joerg Meltzer
        Loreyna Yeung   
        Rob Polocz
        Gregor Herrmann
        H.Merijn Brand
        endacoe
        Pat Mariani
        Sergey Pushkin

From libspreadsheet-xlsx-perl 0.18-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.