HOWTO: Import from Anki to Pleco

A quick and dirty note about how to export flashcards from Anki and import them in Pleco. I’m assuming some familiarity with both Anki and Pleco.

  1. Open your deck in Anki.
  2. Go to File->Export.
  3. Set the export format to “Facts in tab-separated text file”.
  4. (Optional:) Limit by tags.
  5. Click “Export to…”. You will have to select a file to save to.
  6. You then need to rearrange the output of Anki. Anki outputs its data as: Chinese TAB English TAB Pinyin. Pleco wants Chinese TAB Pinyin TAB Chinese. Any macro or script which reorders the second and third field will do the trick. I use the following:

    $ gawk -F '\t' -- '{print $1"\t"$3"\t"$2}' [exported file] > [fixed file]

    “[exported file]” is the file previously exported from Anki. “[fixed file]” is where to save the output.

  7. Shove “[fixed file]” onto a flash card or transmit it to the device running Pleco.
  8. In Pleco, select “Modules->Open Flashcards…”.
  9. 9. Click the “Import” button.
  10. 10. Set the following:
    • Source: the file you want to import.
    • Card Language: Chinese-English
    • Text Encoding: UTF-8
    • Missing Entries: Create Blank
    • Ambiguous Entries: Prompt
    • Duplicate Entries: Prompt
    • Store imported defns in user dict: unchecked
  11. Hit start. Make sure the sample data looks good. Hit yes if it does look good.
  12. Exercise left to the reader: check that your cards look good after importing.

Leave a Reply

Your email address will not be published. Required fields are marked *