fixed comma extra fields issue

This commit is contained in:
B.J. Dweck 2023-09-07 14:20:31 +03:00
parent 3c7ee303a4
commit 37656695d8

View File

@ -21,9 +21,15 @@ MY_MODEL = genanki.Model(
def csv_to_anki(csv_path, output_path):
with open(csv_path, 'r', encoding='utf-8') as f:
reader = csv.reader(f)
# Skipping the header row
next(reader, None)
my_deck = genanki.Deck(2059400110, "CSV Deck")
for row in reader:
question, answer = row
# Use row directly without splitting
question = row[0]
answer = ",".join(row[1:])
note = genanki.Note(
model=MY_MODEL,
fields=[question, answer]