Files
spplus/exporter.cs

19 lines
601 B
C#

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);
}
}