akeneo/spreadsheet-parser-bundle

This package is abandoned and no longer maintained. The author suggests using the akeneo-labs/spreadsheet-parser-bundle package instead.

Akeneo spreadsheet parser bundle

Installs: 3 926

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 20

Forks: 1

Type:symfony-bundle

v1.1.2 2015-10-05 08:35 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:35:39 UTC


README

This component is designed to extract data from spreadsheets, while being easy on resources, even for large files.

The actual version of the spreadsheet parser only works with xlsx files.

Installing the bundle

From your application root:

$ php composer.phar require --prefer-dist "akeneo-labs/spreadsheet-parser-bundle"

You will then have to add the bundle to your AppKernel :

$bundles[] = new Akeneo\Bundle\SpreadsheetParserBundle\AkeneoSpreadsheetParserBundle();

Usage

To extract data from a spreadsheet, use the following code:

<?php

[...]

class MyService implements ContainerAwareInterface
{
    public method readSpreadsheet()
    {
        $loader = $this->container->get('akeneo_spreadsheet_parser.spreadsheet_loader');
        $spreadsheet = $loader->open('myfile.xlsx');

        $myWorksheetIndex = $spreadsheet->getWorksheetIndex('myworksheet');

        foreach ($spreadsheet->createRowIterator($myWorksheetIndex) as $rowIndex => $values) {
            var_dump($rowIndex, $values);
        }
    }

    [...]
}