ccc

Mostrando entradas con la etiqueta CSV. Mostrar todas las entradas
Mostrando entradas con la etiqueta CSV. Mostrar todas las entradas

Convertir fichero CSV a Excel

include 'PHPExcel/IOFactory.php';
$objReader = PHPExcel_IOFactory::createReader('CSV');
$objReader->setDelimiter(";");
$objReader->setInputEncoding('UTF-8');
$objPHPExcel = $objReader->load('MyCSVFile.csv');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('MyExcelFile.xls');

CSV: Convertir una tabla a CSV

Descargar este plugin:
http://www.jqueryscript.net/table/jQuery-Plugin-To-Convert-HTML-Table-To-CSV-tabletoCSV.html

<head>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="jquery.tabletoCSV.js"></script>
</head>

<body>
<table>
    <tr>..</tr>
    <tr>..</tr>
    <td>..</td>
    <td>..</td>
    <td>..</td>
    <td>..</td>
    <td>..</td>
    <td>..</td>
    <td>..</td>
    <td>..</td>
</table>

<button id="export" data-export="export">Exportar a CSV</button>

<script>
$(function() {
    $("#export").click(function(){
     $("table").tableToCSV();
    });

});