const xlsx = require('xlsx');

const data = [
    { RollNumber: 'N2026-001', Name: 'John Doe', Physics: 160, Chemistry: 170, Biology: 320 },
    { RollNumber: 'N2026-002', Name: 'Jane Smith', Physics: 175, Chemistry: 175, Biology: 360 },
    { RollNumber: 'N2026-003', Name: 'Rahul Kumar', Physics: 100, Chemistry: 120, Biology: 260 },
    { RollNumber: 'N2026-004', Name: 'Priya Sharma', Physics: 130, Chemistry: 140, Biology: 250 },
    { RollNumber: 'N2026-005', Name: 'Arun M', Physics: 170, Chemistry: 155, Biology: 360 }
];

const worksheet = xlsx.utils.json_to_sheet(data);
const workbook = xlsx.utils.book_new();
xlsx.utils.book_append_sheet(workbook, worksheet, "Marks");

xlsx.writeFile(workbook, "sample_marks.xlsx");
console.log("sample_marks_v2.xlsx generated successfully.");
