6c38cd0019
- Cascade delete on all entities (student, module, UE, user, role, promotion) - Fix Response body reuse bug (factory functions instead of constants) - Student note viewing via CAS uid (strip non-digit prefix) - Fix middleware page visibility for students in LOCAL mode - Import result popup component (shared across all import pages) - Fix student import to use numEtud from Excel - Bulk student selection with promo change and delete - Move UE/UE-Module API and pages from notes to admin module - Move promotions page from students to admin module - Multi-year maquette import with per-year promo selection - Inline promo creation in maquette import - Static Excel templates (students, notes, maquette) - Fix XLSX export using blob download instead of writeFile - Allow students to read modules list (GET /modules)
26 lines
1.2 KiB
TypeScript
26 lines
1.2 KiB
TypeScript
// @deno-types="https://cdn.sheetjs.com/xlsx-0.20.3/package/types/index.d.ts"
|
|
import * as XLSX from "https://cdn.sheetjs.com/xlsx-0.20.3/package/xlsx.mjs";
|
|
|
|
for (const file of ["FISE-INFO-2025.xlsx", "FISA-INFO-2025.xlsx"]) {
|
|
console.log(`\n=== ${file} ===`);
|
|
const wb = XLSX.read(Deno.readFileSync(`Excels/${file}`), { type: "array" });
|
|
console.log(`Sheets: ${wb.SheetNames.join(", ")}`);
|
|
|
|
for (const sheetName of wb.SheetNames) {
|
|
console.log(`\n--- Sheet: ${sheetName} ---`);
|
|
const sheet = wb.Sheets[sheetName];
|
|
const rows = XLSX.utils.sheet_to_json<(string | number | null)[]>(sheet, { header: 1 });
|
|
// Print first 5 cols of each row, mark rows that look like year/semester headers
|
|
for (let i = 0; i < rows.length; i++) {
|
|
const row = rows[i];
|
|
if (!row || row.length === 0) continue;
|
|
const col0 = row[0] != null ? String(row[0]).trim() : "";
|
|
// Show rows that are structural (year, semester, UE headers)
|
|
if (col0 || (row[1] != null && String(row[1]).trim())) {
|
|
const preview = row.slice(0, 6).map(c => c != null ? String(c).substring(0, 25) : "").join(" | ");
|
|
console.log(` [${i}] ${preview}`);
|
|
}
|
|
}
|
|
}
|
|
}
|