5

I dont know what im doing wrong, or maybe its something normal. I have to load and "read" a excell with about 12000 rows. I use this code for that.

Excel::selectSheetsByIndex(0)->load($path.$fileName, function ($reader) {
    $reader->each(function($row){
        Log::info('$row');
    });
});

As you can see, there is nothing heavy wich could make the read so slow. I need to process hte data after the reading, so is a problem if only reading takes more than 5-10 minutes.

I tried also with the chunk filter, but nothing went better.

Is this normal?

I know excel reading is slow, as i read in other questions, but "this" slow? Thank you.

Marek Skiba
  • 2,124
  • 1
  • 28
  • 31
Sampudon
  • 85
  • 1
  • 8

1 Answers1

1

You could use Laravel Fast Excel which aims to be faster. It has less feature, but it's OK for a simple XLSX import.

(new FastExcel)->import('your-file.xlsx', function ($row) {
    // Do what you want with this line, you can use it as an array.
    dump($row);
});
rap-2-h
  • 30,204
  • 37
  • 167
  • 263