Bulk find and replace new words in a field?

Hi I’m new to Anki and I have this problem with my Notes when learning new vocabulary

1. I have “Word” and “Definition+Examples” Fields in my Reverse Note Types with 2 Card types “Forward” and “Backward”.

2. I want to Bulk Replace new words in the “definition+examples” with […]
(like Cloze but I’m using reverse note type so I’m trying to use Find and Replace instead)

3. Is there any way I can bulk replace the exact new word in the example with […] by using find and replace, HTML in templates, etc??? Please help


• Forward card


• Backward card

• Find and Replace

1 Like

Well, I fear the answer is no.

You definitively can’t do that in bulk for your whole collection, because what you want to replace actually depends on the note. If they were in the same field, it might technically be possible with regex to fetch the word you want to replace, and replace it, but it would be extremely convoluted.

However, even if you could, it would probably be the wrong solution because “Defitnion+Examples” is a field that is used both in the Front and in the Back template, so if you were to change it in the note, it would be affected in both places. This suggests that this should be handled (at least in part) in the card template, not in the note.
To do so, you would need a JS script, for instance, that would search for occurrences of the word that is asked in the definition or in the examples and hide them, but only in the Front template. This would be easy to implement, but probably still not quite what you want, since it’s pretty hard to accurately locate which words in a sentence you want to hide, because of inflections for instance.

This means that the best way to do it (at least, AFAIK) is to put the words you want to hide inside tags with class=tohide or something, and then hide these with JS. If you want an example of a deck that works like that, I would suggest taking a look at Essential Idioms in English: you’ll see all the technical details required for that, as well as how it works in practice, if it matches your expectations, …

However, beware that this would still require to manually annotate all the words you want to hide.

2 Likes

Thanks for the helpful suggestions!

At first, I only want to replace the new word in the example of the Backward card type. But then I realized that changing it in the note type would affected the Forward card type (both in the Front and in the Back template). But it doesn’t matter because I just need the new words to be removed, so I can test my ability to recognize new words and my ability to generate them (in sentences).

• I have tried the following:

  1. I tried Advanced Copy Fields extension (Advanced Copy Fields - AnkiWeb). It’s pretty cool but doesn’t have the features I need

  2. I exported those notes to an excel file and used the =REPLACE function. But because I didn’t manually add new words in Anki (I use the extension “Online Dictionary Helper” to quickly add new words), the column “Definition+Examples” in excel is not in text like other columns but for some reason it’s HTML. And after I import the excel file back into Anki it also in HTML. (all the other columns/fields are export/import normally(in text) except for the “Definition+examples” field/column).

  3. Now I’m using Autohotkey to automatically get the new word in the “Word” field and put it in the Find and Replace window to replace the exact new word in the “Definition+Examples” field in bulk — > Each word will take 1.9s to be replaced

If you add new words manually you can consider the 2nd one, it will save you time.
If possible please point out where I did it wrong!

I think Anki should improve its Cloze and Find and Replace features for this “Recognition” and “Production” language learning method to be used more effectively.