r/Anki•
RemoteDoc

Is there a script or way to add cards to a deck (or create a new deck) based on a field name?

**Field content I mean.
What I have is imported thousands of cards into an anki deck. These cards were imported from a CSV file. One of the Fields was "Subject". So it would say in subject "Calculus" or "Trig"
What I am looking for, is if anyone has designed (or can design) a simple script that creates a new deck, and moves these cards to said new deck, based on the "Subject" field.
Additionally, it would be nice if it moved all of the cards into a child deck of the parent deck. So if I manually created a "Trig" deck, and the cards were labeled "Triangle" "Slope" etc. then it would move the respective cards to Trig::Triangle, or Trig::Slope.

Posted Dec 14, 2016, 9:37 PM UTC · edited

13
dmikalova•

Just open the browser and then you can search for the Subject field for Trig and then mover them to a new deck.

Browse search: "Subject":"Trig"

You should be able to select all the cards now with ctrl+a, and then Edit>Change Note Type (ctrl+shift+m).

2
dedu6ka•

What I am looking for, is ... a simple script that creates a new deck
( do u mean 'decks' ?), and moves these cards
( do u mean 'all' cards ?) to said new deck, based on the "Subject" field.

You are aware of Subdecks but do not want to do it manually - that's why u ask for a script ?

Additionally, it would be nice if it moved all of the cards into a child deck
( do u mean 'deckS' ?) of the parent deck.

So if I manually created a "Trig" deck, and the cards were labeled "Triangle" "Slope" etc. then it would move the respective cards to Trig::Triangle, or Trig::Slope.

This is a statement; what is the question ?

1
RemoteDocOP•

Sorry for the confusion. Yes, to your first question: I am aware of subdecks, but do not want to do it manually in the browser as specified. Basically, I will be importing a comma delimited file into anki with thousands of questions at a time. Each card will have a subject field. I would ideally like to bulk move (manually via the browser) many of these subjects under a "parent" deck (ie: "Trig") and then run a script that makes subdecks for each of the "child" decks (ie: Trig::Triangle; Trig::Slope). The reason this would be cumbersume to do manually, is that there are at times 20-30 cards per child deck, and there are also at time 20-30 child decks, per parent deck (not to mention many parent decks). The move of all the cards into to the parent deck, I can do in the browser, but the creation of new children (or sub-)decks based on the "subject" field, I would want to be done via a script.

1