MIGRATION VERS GITEA
This commit is contained in:
commit
5f9d991c15
333 files changed
+108514
No files matched your search
@@ -0,0 +1,16 @@
|
||||
const XLSX = require('xlsx');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const csvPath = path.join(__dirname, '..', 'public', 'horaires_example.csv');
|
||||
const outPath = path.join(__dirname, '..', 'public', 'horaires_example.xlsx');
|
||||
|
||||
if (!fs.existsSync(csvPath)) {
|
||||
throw new Error(`CSV example not found: ${csvPath}`);
|
||||
}
|
||||
|
||||
const csvContent = fs.readFileSync(csvPath, 'utf8');
|
||||
const workbook = XLSX.read(csvContent, { type: 'string', raw: false, FS: ',' });
|
||||
XLSX.writeFile(workbook, outPath);
|
||||
console.log('Wrote', outPath);
|
||||
|
||||
Reference in new issue
Block a user