[feat:] csv-exporter (basic implementation)

This commit is contained in:
2026-03-19 08:48:01 +01:00
parent a83f97828c
commit 9bbde62d70

19
exporter.cs Normal file
View File

@@ -0,0 +1,19 @@
using System.IO;
namespace spplus;
public static class ExportUtility
{
public static void ExportToCSV(string filepath)
{
char separator = ',';
string header = $"SchuelerID{separator}Sem1{separator}Sem2{separator}Sem3{separator}Sem4";
string output = header + "\n";
foreach (var student in Settings.Instance.Students)
{
output += $"{student.ID}{separator}{student.Result[0]}{separator}{student.Result[1]}{separator}{student.Result[2]}{separator}{student.Result[3]}\n";
}
File.WriteAllText(filepath, output);
}
}