Hi, I haven’t been able to find a solution to the following problem:
I have a large deck with cloze cards that contain multiple clozes per card. The problem is that they’re all labeled as c1 so they are all reviewed at the same time on the same card.
Is there a possibility to automatically renumber them? So that each card only reviews 1 cloze at a time while still showing me the rest of the information on the card?
This could theoretically be done with some very careful use of Find-and-Replace with regex searches. [Example that doesn’t quite fit what you need, but shows you what would be involved: Multiple Find and Replace - #2 by kleinerpirat .]
- How are you with regex? [And “I don’t even know what you’re talking about” is a perfectly acceptable answer!
]
- How many notes do you need to do this to?
- Is the text fairly regular/consistent – which makes the likelihood of being able to do this much better?
[I’m sort of surprised there isn’t already an add-on that does this, but I don’t see anything promising.]
1 Like
Assuming that all of your clozes are c1 and that you want to make them all different, here is a way to do it with find & replace:
- Make a backup.
- Select the notes you want to change and open the find & replace dialog.
- Paste
([\s\S]*?\{\{c1::[\s\S]*?\}\}[\s\S]*?\{\{c)1(::[\s\S]*?\}\}[\s\S]*) into the “Find” box.
- Paste
${1}X${2} into the “Replace With:” box, where “X” is the largest cloze number so far + 1.
- Repeat from step 2 until Anki says that no notes were modified.
So basically, you do the replacement with ${1}2${2} first, then with ${1}3${2}, then with ${1}4${2}, etc. until there are no more duplicate c1 clozes.
2 Likes