Import - field mapping - Nothing

I am importing a text file to add a new field to each card in a deck. Under the field mapping section, it only has options for each of the values in the CSV .txt file, as well as “Nothing”. Is “nothing” going to delete pre-existing data fields or keep them as is?

If it deletes things, then since I have modified a lot of cards in anki, I suppose the right way would be to export an anki deck as a .txt file, ADD the additional field, and then re-import it? Bc if I exported it in anki format I could not add a CSV field for the new field. And I want to keep the learning data.

And if it does deletes things, a suggestion would be an option to maintain a field as it is.

“Nothing” means don’t map that column to any of the fields in these notes. Basically, discard that data instead of importing it. You wouldn’t use it with pre-existing data – if you want to get rid of a field in Anki, you would delete it directly from the note type. [see more helpful answer below]

If your goal is to add a new field and populate it, your workflow would be –

  • Add the field to your note type first
  • Export as text
  • Populate that new field/column with what you want to add to your notes
  • Re-import to update the notes

You can do that by mapping that field to what it already is.

There is no option to map the field to what it already is, the only options are to select from data I am importing OR 'Nothing". But since I have modified pre-existing fields in anki directly as I am reviewing cards, I do not have the data externally to re-import, I have to do the extra step (if I understand your instructions) of exporting the deck as a .txt file, then add the new field, and then import it. Versus just importing the new field and leaving existing fields as-is.

Are you trying to create a field on your note type by importing data into it? You can’t do that. You have to create the field in Anki first, or there’s no where to import to.

The key to populating your new field during import is to leave everything in the other fields the same.

I had a note type with 4 fields, I imported the data using .txt import.
I have been using this deck for some time, so the data in the fields has been modified when I notice mistakes, improvements, etc.
I added a 5th field in the note type, which is now blank bc there is no data.
I have data to import into this field.

There is no option in field mapping to leave the 4 other fields the same. It only allows me to choose “Nothing” or I have to select what I want to import there. But I don’t have the data to import, it’s in anki. So I have an extra step of exporting the deck to get the 4 fields to re-import into fields that do not need to be touched.

I thought originally that maybe “Nothing” did nothing to the field, but from what I understand from your explanation it will delete the data. So ideally it would say “Delete” and there should be another option “Leave as is”

“Nothing” it will leave the data unchanged. But you should still make a backup and be ready to undo everything if something goes wrong (ctrl+z for windows).

https://docs.ankiweb.net/importing/text-files.html#duplicates-and-updating

When importing text files, Anki uses the first field to determine if a note is unique. By default, if the file you are importing has a first field that matches one of the existing notes in your collection and that existing note is the same type as the type you’re importing, the existing note’s other fields will be updated based on content of the imported file. A drop-down box in the import screen allows you to change this behaviour, to either ignore duplicates completely, or import them as new notes instead of updating existing ones.

Ah, I see.

I find this manual explanation quite confusing:

But this does not happen automatically, the user has to select each field manually under “field mapping”

“Duplicates” makes it sound like it is talking about individual cards, not fields.

But now it is talking about entire notes.

Also no mention of what “Nothing” means.

For me, importing is the most difficult part of anki. Although I have already performed this procedure several times, I no longer remember how it is done. But if I need to do it again, then by trial and error I will quickly cope. I advise you to make a backup and try it.

I think what you are noticing is that some of the new import features have gotten ahead of their documentation.

FYI the “Nothing” to leave the fields the same worked perfectly!

1 Like