Issue
I downloaded the packages from https://github.com/akeneo/spreadsheet-parser and when I run it from my php file "as in Usage", I got the error
Fatal error: Class 'Akeneo\Component\SpreadsheetParser\SpreadsheetParser' not found
- P.S. I'm using WAMP the latest version, windows 7
thanks
Solution
I contacted with the author, and I figured out that I didn't install composer.. and as I don't know anything about it, so he did some edits on his code, and send it to me, so I can use it directly.. anyways, I'll put a snippet of php code, beside that I'll upload the file, to help anyone how face the same problem, and need to parse large worksheet xlsx or csv
<?php
require 'vendor/autoload.php';
use Akeneo\Component\SpreadsheetParser\SpreadsheetParser;
$workbook = SpreadsheetParser::open('FL_insurance_sample.csv');
$myWorksheetIndex = $workbook->getWorksheetIndex('myworksheet');
foreach ($workbook->createRowIterator($myWorksheetIndex) as $rowIndex => $values) {
echo implode(',',$values);
}
?>
- you can download the package directly from here: csv_parser.zip
Answered By - Hossam Answer Checked By - David Goodson (PHPFixing Volunteer)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.