From 8739f1acab8366dceb4b5ae624c4181b585f134a Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Fri, 12 May 2023 12:55:09 -0400 Subject: more general converters for grades csv files --- regenBlackboardDB.sh | 6 +++--- regenGradescopeDB.sh | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/regenBlackboardDB.sh b/regenBlackboardDB.sh index 4231683..08c021b 100755 --- a/regenBlackboardDB.sh +++ b/regenBlackboardDB.sh @@ -1,10 +1,10 @@ #!/bin/bash CSVFILE="$1" -bbfile=Blackboard.db -rm -f "$bbfile" +dbfile=Blackboard.db +rm -f "$dbfile" printf ".mode csv\n.import \"$CSVFILE\" export_table" | \ - sqlite3 "$bbfile" + sqlite3 "$dbfile" diff --git a/regenGradescopeDB.sh b/regenGradescopeDB.sh index 774f624..e7273ea 100755 --- a/regenGradescopeDB.sh +++ b/regenGradescopeDB.sh @@ -1,7 +1,10 @@ #!/bin/bash -rm -f 2021_Gradescope.db -printf '.mode csv\n.import 2021_Gradescope.csv export_table' | \ - sqlite3 2021_Gradescope.db +CSVFILE="$1" +dbfile=Gradescope.db +rm -f "$dbfile" + +printf ".mode csv\n.import \"$CSVFILE\" export_table" | \ + sqlite3 "$dbfile" -- cgit v1.2.3