Issue importing Mnemosyne cards into Anki

Hello - I’d like to import a Mnemosyne 2.73 .db file (~100k cards) into Anki, but I keep getting this error: 500: JsonError { info: “invalid type: floating point 1736293344.5096483, expected i32 at line 1 column 8848” }

Can anyone help me with this problem? Also, assuming it is still possible to import Mnemosyne cards into Anki, is there a way to maintain the scheduling data? I have been learning these cards for years and would really prefer to not have to start from scratch. Thanks!

We recently discussed some of the issues with Mnemosyne imports and workarounds to try. But I don’t know whether a “Mnemosyne 2.73 .db file” is similar enough to a Mnemosyne 2.0 db file to work with the same process.

Please use a file-sharing service like Google Drive to share a link to the file with me privately on anki.tenderapp.com

Thanks for providing the file. A fix for this will be in the next beta build, which will hopefully be available within a few days.

1 Like

Just following up on this - thanks to the new beta build, I was able to upload my Mnemosyne cards to my Anki database, and it looks like the learning data is more or less intact. But I’ve run into a problem - the clozes themselves are not recognized (“No cloze ⁨2⁩ found on card. Please either add a cloze deletion, or use the Empty Cards tool”) so I can’t review them.

I assume this is because they’re in the Mnemosyne Cloze style (e.g. [text]) and not the Anki cloze (e.g. {{c1::text}} style. Is there an easy way for me to convert all my notes at once (including ones with multiple clozes), perhaps with the Find and Replace function? Please let me know!

Yes, that’s why – but don’t use Empty Cards if you brought over review history with those cards that you want to keep. It will delete those cards and their history.

And yes, you can do that with Find and Replace. You’ll need some knowledge of RegEx but it’s pretty straightforward (and if you post a sample text, I bet someone could help you figure it out). But are the Mnemosyne clozes not numbered? That might be extra challenging …

Another way to make a change like this is by exporting the fields to a text/CSV so that you can manipulate the text, and then re-importing it to update your notes. Which option will be easier depends a lot on what tools you’re most comfortable working with (and how many notes need fixing).

Yeah, the Mnemosyne clozes aren’t numbered. Here’s an example card:

[Elizabeth Bennet] is the protagonist of [Jane Austen]'s novel [Pride and Prejudice].

I want to use Find and Replace to convert this to

{{c1::Elizabeth Bennet}} is the protagonist of {{c2::Jane Austen}}'s novel {{c3::Pride and Prejudice}}.

I’ve been able to use F&R to convert […] to {{c1::…}}, but I’m not sure what syntax is needed to get the program to recognize each of my clozes as distinct and label them accordingly.

If I instead exported the cards to text/CSV, edited them and then re-imported them in that form, wouldn’t I lose the learning data?

Let’s deal with the easy part first – no, you wouldn’t. As long as you make sure your notes remain updatable during the export/import process, Anki will update your notes.

I think with some careful regex, this will work if you go one cloze at a time.
By that I mean, limit your action to just the first [] pair, and replace that as a c1. Then you can narrow yourself to just looking at notes that still have a [] pair, and act only on the now-first pair by replacing that as a c2, and so on.

My regex is at a “dabbler” level, but if you post what search you’re using, I might be able to help you customize it. (As long as you promise to backup before using anything I give you, and Undo as necessary!)

I can’t think of a way you can accomplish this in Anki without some programming. You may want to consider paying someone to automate the process for you, if you don’t get any better suggestions. @abdo might be interested. Alternatively, you could replace all clozes with c1, then manually edit notes as you encounter empty cards during review.

Here’s the search I’ve been using:

Find: “[”

Replace: “{{c1::”

I then repeat this with “]” and “}}” to complete the cloze modification. I’m sure that there is regex to do “[…]” to “{{c1::…}}” all at once, but I haven’t figured it out yet. Anki already recognizes my individual Mnemosyne clozes as Cloze 1, Cloze 2, etc. when it comes to the browser function - so if there’s a way to use the F&R function to specifically modify cards instead of entire notes, then I think we’d be in great shape.

There isn’t. You can modify notes and templates – the cards themselves are Anki’s territory. Especially because the cards exist already, assigning clozes to them in the way Anki expects will be your the best bet.


Okay, I make no claims that this is the most elegant way to do this – but I just successfully turned your text into this with 3 successive F&Rs, so I think it’s worth a shot!

{{c1::Elizabeth Bennet] is the protagonist of {{c2::Jane Austen]'s novel {{c3::Pride and Prejudice].

I tested this by creating a 3-cloze note, and then replacing the text with your bracketed text, so I had 3 this-card-is-blanks. After the replaces, the 3 cards were successful clozes again.

You’re right that you can take care of the end brackets/braces with a single find ] & replace }} – so do that first. I assume you don’t have any square brackets in your notes for any other purpose? And is it safe to assume there are no line-breaks within the notes?

Consider limiting it to the one field you need – but definitely check “Selected notes only.” For the end brackets, untick “Treat input as regular expression” – for the below, tick that.
image

Looks like gibberish, but here’s what this means –

  • Find everything that is not [ and grab that as 1
  • Find one [
  • Find everything else and grab that as 2
  • Then put back 1{{c1::2

You’ll do it once for c1, and then the 2nd time through change it to c2, etc.

[Please backup before you start! Then try it on just one note so you can see the change happening, and undo as necessary!]

find:
([^\[])\[(.*)
replace:
${1}{{c1::${2}

then replace:
${1}{{c2::${2}
then replace:
${1}{{c3::${2}

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