Q q - Text as a Database. See Examples Below
Importer ses contacts pour Gmail
Convertisseur JSON en CSV
ConvertCSV
Convert CSV Text into a HTML TableCSV to VCF (vCard) Converter Textfixer
Convert HTML table to CSV in jQuerychrome./htmltablecsv
CsvParser
csv-to-html
CSV to HTML :
<?php
$row = 1;
if (($handle = fopen("sites/default/files/exemple.csv", "r")) !== FALSE) {
echo '<table border="1">';
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
$num = count($data);
if ($row == 1) {
echo '<thead><tr>';
}else{
echo '<tr>';
}
for ($c=0; $c < $num; $c++) {
//echo $data[$c] . "<br />\n";
if(empty($data[$c])) {
$value = " ";
}else{
$value = $data[$c];
}
if ($row == 1) {
echo '<th>'.$value.'</th>';
}else{
echo '<td>'.$value.'</td>';
}
}
if ($row == 1) {
echo '</tr></thead><tbody>';
}else{
echo '</tr>';
}
$row++;
}
echo '</tbody></table>';
fclose($handle);
}?>
***2EME SOLUTION :
<html>
<body>
<table border="1">
<?php
//ouverture du fichier a traiter
$fp = fopen ("result.csv","r");
//affichage du tableau
while ($data = fgetcsv ($fp, 1000, ";")) {
$num = count ($data);
print "<tr>";
for ($c=0; $c < $num; $c++) {
print "<td>".$data[$c]. "</td>";
}
echo'</tr>';
}
//affichage de la colonne 1 du tableau :
while ($data = fgetcsv ($fp, 1000, ";")) {
print "<tr>";
print "<td>".$data[0]."</td>";
echo'</tr>';
}
//fermeture du fichier result.csv
fclose ($fp);
?>
</table>
</body>
</html>
*** CSV_to_HTML_translation#PHP
Datatables.net
D3 tuto
D3 ex csv2html
Dafizilla-table2clipboard /firefox
//ouverture du fichier html $hHtml = fopen("./fichier.html", "r+"); //ouverture du fichier csv $hCsv = fopen("./fichier.csv", "w+"); //lecture du fichier html $contents = array(); while(($str = fread ($hHtml, 8192))!=false){ array_push($contents, $str); } fclose ($hHtml); //traitement de la lecture $new_contents = array(); while(sizeof($contents)){ $str = array_shift($contents); $str = preg_replace('`<th([^>]+)>`', '"', $str); $str = preg_replace('`</th>`', '";', $str); $str = preg_replace('`<td([^>]+)>`', '"', $str); $str = preg_replace('`</td>`', '";', $str); $str = preg_replace('`\s`', '', $str); $str = preg_replace('`<html>|<body>|<tbody>|<tr>|</tbody>|</a>|<div([^>]+)>|<thead>|</thead>|<a([^>]+)>|<table([^>]+)>|<h([^>]+)>|</h([^>]+)>|<img([^>]+)>|<tr([^>]+)>`', '', $str); $str = preg_replace('`</tr>`', '\\r\\n' , $str); $str = preg_replace('/""+/', '', $str); array_push($new_contents, $str); } //écriture du fichier csv while(sizeof($new_contents)){ fwrite($hCsv, array_shift($new_contents)); } fclose($hCsv);ExcellentExport
ExportHTMLTable
Export_Word_Excel_PDF_CSV_HTML
function.fgetcsv.php
How-to-import-csv-file-in-your-php-application
Importation CSV
PHP et CSV
stackoverflow/how-do-i-export-html-table-data-as-csv-file
Table2CSV
Unix.com/shell-programming-and-scripting/html-table-csv
unix.stackexchange/convert-csv-to-html-table
XL2Csv
Zamzar files online converter
Aucun commentaire:
Enregistrer un commentaire