Xavier Caron > Spreadsheet-XlateExcel > Spreadsheet::XlateExcel

Download:
Spreadsheet-XlateExcel-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Spreadsheet::XlateExcel - Trigger a callback subroutine on each row of an Excel spreadsheet

VERSION ^

Version 0.02

SYNOPSIS ^

This modules triggers a callback subroutine on each row of an Excel spreadsheet.

Wrote this simple module because I was fed up from writing the same boilerplate code ever when I had to mine spreadsheets for data.

Operates on every sheet unless a given sheet is targeted by name, RE inclusion or RE exclusion.

Operates on every column unless targeted by column head name or RE (inclusion).

For example:

    use Spreadsheet::XlateExcel;

    my $id = Spreadsheet::XlateExcel->new ({ file => 'sheet.xls' });

    # rip odd rows of "Sheet2" sheet

    my $lol;

    $id->xlate ({
        on_sheet_named  => 'Sheet2',
        for_each_row_do => sub {
            my ( $sheet_id, $row, $row_vs ) = @_;

            push @$lol, $row_vs unless $row % 2;
        },
    });

METHODS ^

new

  my $id = Spreadsheet::XlateExcel->new ({ file => 'sheet.xls' })

Ye constructor.

xlate

  $self->xlate ({ for_each_row_do => sub { my ( $sheet_id, $row, $row_vs ) = @_ ; ... } })

Applies for_each_row_do sub to each row of each sheet (unless filtered, see below) of the book.

Options:

Callback function gets called for each row, fed with Spreadsheet::ParseExcel::Worksheet ID, row index and arrayref of row values parameters.

Returns self.

book_id

  my $book_id = $self->book_id ()

Accessor to Spreadsheet::ParseExcel::Workbook instance ID.

AUTHOR ^

Xavier Caron, <xav at cpan.org>

BUGS ^

Please report any bugs or feature requests to bug-spreadsheet-xlateexcel at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Spreadsheet-XlateExcel. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Spreadsheet::XlateExcel

You can also look for information at:

Code is available through github (http://github.com/maspalio/Spreadsheet-XlateExcel).

ACKNOWLEDGEMENTS ^

To Kawai Takanori, Gabor Szabo and John McNamara, authors of cool http://search.cpan.org/dist/Spreadsheet-ParseExcel/ module.

LICENSE AND COPYRIGHT ^

Copyright 2010 Xavier Caron.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

syntax highlighting: