3

I have a big CSV file with Latin vocabulary with a unit number
Like this:

latin word;german word;Unit 01
...
latin word;german word;Unit 02
...

How can I

  • create multiple decks
  • import the vocabulary into the right deck

in Anki in one go?

I have no problems with reformatting the CSV with regex etc. Thanks!

Nicolas Raoul
  • 11,561
Quanten
  • 143

2 Answers2

2

This is now possible as of Anki 2.1.54 as per this documentation

Here is the procedure:

  • Sort your csv file so that every deck is in alphabetical order. Otherwise you will end up with hundreds of decks named: deck++++++++++++++
  • Edit the top of your csv file using a text editor like notepad, not excel.
  • Add the following line: #deck column:2 to the very top of the file. The # is required.
  • Change the column number to the column with the deck name

You will know this is working correctly, when the import dialogue has the deck field greyed out when you go to select which field is which.

Notes:

  • As far as I know the decks have to be in the format TopDeck::Sub::Sub2 with the old :: between lines.
  • Make sure you have a top deck name, so the cards don't end up scattered everywhere.

Re-importing:

If you would like to make changes to a deck in csv, you have to set the GUID for each card so you don't end up with duplicates.

  • Add the following line: #guid column:1 to the very top of the file. The # is required.
  • Then specify a custom string of letters and numbers for each card. For my Advanced Spanish Deck, I took the NID of each card directly from Anki, processed it with Python to clean it up a bit and remove images, and then prepended "ASW" on the front of each NID to create a unique string so that Anki will recognize the cards even if I change the front somehow.
  • If you change a card's subdeck in the csv after importing, it will not change when imported again into Anki. The only way I know to fix this is to completely delete the anki cards and then reimport them all from csv again.

Example:

Here are the first 3 lines of a working csv ready to be imported into anki. I'm using semicolon as a delimiter for easy importing.

#guid column:1
#deck column:2
ASW1321299137982;Advanced Spanish Words::Adj & Adv;Llano (Adj);Flat, plain (adj);2;
SurpriseDog
  • 197
  • 13
0

I have not found a solution for that particular problem, but I achieved my goal of learning only some units, which I want to share.

It basically follows the suggestion of vinnief in the comments of the question.


Tags and suspend Cards

I imported my CSV as mentioned in the question into one deck and imported my unit field into the Tag field of the cards. Then I used the card browser to suspend all cards I doesn't want to study

Quanten
  • 143