From 9bbde62d703afd228de5f5ada1f300f80ca7a5c4 Mon Sep 17 00:00:00 2001 From: Elias Fierke Date: Thu, 19 Mar 2026 08:48:01 +0100 Subject: [PATCH] [feat:] csv-exporter (basic implementation) --- exporter.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 exporter.cs diff --git a/exporter.cs b/exporter.cs new file mode 100644 index 0000000..6f03c50 --- /dev/null +++ b/exporter.cs @@ -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); + } +} \ No newline at end of file