From 569fe38f54b21d9b7de5a8b48cbf14987383281d Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Mon, 24 Oct 2022 16:43:53 +0300 Subject: Added removal of dumb header in shifts that crashed the parsing --- classes.txt | 8 -------- dbparse.js | 1 + 2 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 classes.txt diff --git a/classes.txt b/classes.txt deleted file mode 100644 index ce5663b..0000000 --- a/classes.txt +++ /dev/null @@ -1,8 +0,0 @@ -ÄI7.1: A205 -FY5.2: B102 -MA8.4: B101 -EA5.2: B209 -FI2.6: B103 -EA5.6: B211 -BI4.2: A102 -HI2.4: B210 diff --git a/dbparse.js b/dbparse.js index a65add0..7e8d8fd 100644 --- a/dbparse.js +++ b/dbparse.js @@ -71,6 +71,7 @@ async function writeShifts(data, DB) DB.query_raw("DELETE FROM shiftnames") ]); + data = data.replace(/RUOKAILUVUOROT.*/, ""); const dbOperations = []; const shiftRegex = /((?:MAANANTAI|TIISTAI|KESKIVIIKKO|TORSTAI|PERJANTAI)?.*)\s*(RUOKAILU.*)\s*(.*)/gmi; const shifts = data.matchAll(shiftRegex); -- cgit v1.2.3