Question: DataTables for large CSV files

Question

DataTables for large CSV files

Answers 0
Added at 2017-01-04 22:01
Tags
Question

I'm using datatables to display data from a CSV file. Some 60k rows. All works well apart from it obviously takes ages (over 70s) to display

<?php 
$result  = [];
if (($handle = fopen("SO.csv?id=2", "r")) !== FALSE) {
    while (($row = fgetcsv($handle, 1000, ",")) !== FALSE) {
        $cols = array($row[0], $row[1], $row[2], $row[3]);
        $reset = false;
        echo '<tr><td>'.$row[0].' </td><td> '.$row[1].' </td><td>  '.$row[2].' </td><td>  '.$row[3].' </td></tr>';
    }
}
?>

Obviously server-side would be an ideal option but I'm not sure how I'd incorporate it whilst reading from a CSV.

Any suggestions? Any other tools/scripts?

Thanks

Answers to

DataTables for large CSV files

Source Show
◀ Wstecz