Update Program.cs
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Has been cancelled

This commit is contained in:
2025-06-10 14:18:04 +00:00
parent c7bb0fe543
commit 9b8c236ecf
+23
View File
@@ -13,6 +13,8 @@ class Program
private static readonly string FolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Simpsons_generator");
private static readonly string OverrideBrowser = Path.Combine(FolderPath, "overrideBrowser.xml");
public static readonly string filePath = Path.Combine(FolderPath, "episodes-watched.csv");
static SQLiteConnection CreateConnection()
{
@@ -137,6 +139,27 @@ class Program
SQLiteConnection sqliteconn;
sqliteconn = CreateConnection();
//check if the old excel exist and convert it to SQLLITE
if (File.Exists(filePath))
{
Console.WriteLine("Excel file present");
var linesRead = File.ReadLines(filePath);
foreach (var lineRead in linesRead)
{
Console.WriteLine(lineRead);
string[] words = lineRead.Split('-');
int season = Convert.ToInt16(words[3]);
int episode = Convert.ToInt16(words[5]);
SaveIntoDatabase(sqliteconn,season,episode);
Console.WriteLine(season);
Console.WriteLine(episode);
}
System.IO.File.Move(filePath,filePath+"_converted.csv");
}
bool restart = false;
do
{