How can you mass change the text in a field of a deck with different text?

Hello,

I have a deck with a lot of cards. I want to mass change the sentences in a certain field with new sentences.

So as an example, this is what I have now:

Card 1
Field A: Old sentence 1

Card 2:
Field A: Old sentence 2

Card 3:
Field A: Old sentence 3

I want to mass-change all the old sentences in Field A to new sentences. I’d then have:

Card 1
Field A: New sentence 1

Card 2:
Field A: New sentence 2

Card 3:
Field A: New sentence 3

If there were to be some kind of mass find and replace that would be helpful I think. So something like this:

Find - Replace
Old sentence 1 - New sentence 1
Old sentence 2 - New sentence 2
Old sentence 3 - New sentence 3

Do you know of such a thing?

Without fully understanding your desired Outcome, there is an addon called
batch editing that should probably do what you want.

Hello,

Thanks for your input! This is however not something that I need. Every card has a different sentence that I need. So I want to select all cards at once, then change what is in Field A for all those cars.

With this addon I would have to copy and paste every sentence one by one. Whereas I want to be able to select all the sentences and replace them with a unique sentence.

I haven’t tested the “Find and Replace” feature in Anki’s Browser, but it appears to be designed to do exactly what you want. You can specify any one field that you want to modify, and if desired you can use a regular expression to just replace anything that is in the field.
image

Another possible way: Export as “Notes in Plain Text,” then use a spreadsheet program such as Excel to make your desired changes, then import.

I think your best bet is, if you have your old and new sentences ordered, to export the notes as a txt file, open them in LibreOffice Calc, replace the old sentences with the new ones and reimport them to Anki with the update existing notes option.

Make a backup first in any case!

If I correctly understand your requirement, you can do this using the Browse window.

  1. From the main window, click the Browse button (or press B on the keyboard). The Browse window will open. Maximize it so you have room to work.
  2. At the top of the window there is a switch for toggling between Notes and Cards. It will be either green or blue depending on the option selected. Click on it to change it to Notes.
  3. Filter your notes to be displayed. You can enter a filter string at the top or click on the items in the left sidebar to select by note type, tag, etc.
  4. Click on a note to edit in the list. You should see your note’s fields appear in the right sidebar where you can edit them. Important: There’s no save button here. Whatever changes you make will take effect immediately, so be careful typing.

Now you can use Ctrl-P and Ctrl-N to go to the previous and next card respectively while you edit. You can use Tab and Shift+Tab to cycle forward and back through the fields you are editing. You should be able to move quickly through all the cards without having to use the mouse.

Here’s what the Browse window should look like if you are not familiar with it.

The find and replace function exists, however I don’t want to individually find and replace 900+ sentences.

Therefore I would rather input 900 sentences at once for find and then 900 sentences for replace.

My cards also have pictures. I am not sure if the notes option works in that way.

Yes, but then I have to manually edit every one. I would like to do everything in one go. When dealing with 1000+ cards this becomes cumbersome.

Have you looked into regular expression (RegEx)? Anki’s Find&Replace supports RegEx (there is a checkbox at the bottom)!

Depending on how different are the new sentences, RegEx may help.

If you struggle with that, you can post some example sentences (screenshots or text, whatever you prefer) and I can help you write the RegEx that should be used.

If the sentences are private in nature, then I recommend that you use AI to help you!

In any case, be sure to backup your collection before carrying out mass operations like the above :slight_smile:

HR

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.