Old cards remain even though they are no longer in CSV file

Is your feature request related to a problem? Please describe.
I found this was posted before in 2020 but the topic was locked (I can’t post links to other topics, but the title was “Import cards: an option to remove items that are not found in the import file”). It didn’t have any further comment, I don’t really understand why it was closed.
I removed entries from my CSV but this change is not reflected when I import the CSV into my existing deck. This is unexpected for me.

Describe the solution you’d like
I have updated my CSV which I’m importing, I have removed some entries from my CSV. However, the entries still remain in my Anki Deck when I import the CSV into my existing deck. The behavior I was expecting is that it would remove the cards that are no longer in the CSV file (or at least give me that option, since they no longer exist). I have a deck that is quite dynamic and which has a lot of entries related to constantly changing geopgraphy, it makes it quite an issue if old entries are still there, because keeping them in would make the whole deck outdated.

Describe alternatives you’ve considered
The other option could be to recreate the deck entirely, but I don’t want to lose progress on my existing cards which aren’t removed.

I use .csv imports too. There are problems with removing cards that are not in an imported .csv file though: Anki has no way of telling whether the cards have been deleted or were part of another .csv (or maybe created in anki via the add notes window). So deleting them will cause undesired behavior for most.
But maybe the devs here find a good way to do it.

As a workaround:

  1. (Keep the cards in the .csv and) suspend them in anki.
  2. Use a first field named “ID”. If you ever have to remove a card you can just leave the ID and enter the card info for the other fields (overwritting the previous cards). You’d have to manually forget those cards though, as they’d keep the history otherwise.

Here’s the link to the post you mentioned:

The system auto closes topics if there is no activity. As you can see, the topic had been closed with 2 years without any activity.

It would definitely be an undesired behavior for notes to be deleted just because they aren’t in the current CSV you’re importing. :grimacing: Yikes!

But there are easy ways to deal with this – add a tags column to your CSV. Instead of deleting those the rows from your CSV, tag them DELETE, then after you import the file, delete those notes from Anki, and delete those rows from your CSV.

Or if you don’t want to add a column, just add a unique string in a certain field.

1 Like

Thank you both for the quick replies! I understand now how it could be undesirable or dangerous to add the behavior I am requesting (although I still think it is a bit of an unusual way that Anki is doing it, I wouldn’t expect people to remove entries from their CSV unless they expected them to also be removed from Anki, but I’m probably wrong about that too then).

Your answers were inspiring me for a workaround. I’m making a script that could be generating the CSV possibly on a different device independently, and in those cases wont have access to the old CSV/deleted rows, so I will probably be doing the inverse of what was suggested as a workaround for now;
I will probably end up adding an “updated timestamp” tag/column, and remove the cards that are before that date (or of course ones that don’t have that tag/column at all). It will be annoying to do it manually (especially when I got so far automating it completely) but I understand there is no other way and there probably won’t be anytime soon.

Thanks again for the help! I will try to lock this thread now.

2 Likes