Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88066

Export excel or csv big row and dynamic column

$
0
0

I have excel data more than 5k rows and 17 columns, I use the nested loop technique in php, but this takes a long time, to process the data using the xls file format takes 45 minutes, while using the csv file format takes 30 minutes , is there a technique to speed up uploading files from excel to the database (I use Postgresql).

I use a nested loop because how many columns depend on the parameters, and for the INSERT or UPDATE process to the database also depends on the parameters.

Here is my code for the import process

<?php
    $row = 5000; // estimated row
    $col = 17; // estimated col
    for($i=1; $i<=$row; $i+=1){
        for($j=1; $j<=$col; $j+=1){
            ## Execute Query, Check Data With Condition then Insert / Update Data 
        }
    }

I use the PhpSpreadsheet library


Viewing all articles
Browse latest Browse all 88066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>