How to reformat ChinesePod ANKI Export

geleise
January 13, 2014, 11:02 PM posted in General Discussion

Hi all,

Just a quick note if you're using ANKI and found as I did that the ChinesePod doesn't quite import the way you want it to. Unfortunately there are probably a billion ways this data could be formatted, so it may be a challenge getting it to work in the way that you want it to. 

You can use an incredible (and age-old!) function called GREP to select patterns matching a certain criteria. In this case, I wanted to convert a 3-column file into a two column file. ANKI interprets a tab as a column separator:

REPLACE
牙齿     tooth     yáchǐ  

WITH
牙齿     tooth yáchǐ

To do this I wrote a quick expression that would only match a tab that was being "hugged" by two roman characters. Since the Chinese characters occur on the far left side, they will be excluded. This find and replace allowed me to quickly and easily convert all of my exported ANKI to the format of chinese characters on the front and pinyin as well as meaning on the back.

Using a program such as TextWrangler, you can run this find and replace.

Here's the FIND: 

([a-zA-Z0-1])(\t)([a-zA-Z0-1]) 

And you can REPLACE: 

\1 \3 


RESULT:
Front of card is characters; back of card contains meaning as well as pinyin. 

Profile picture
james137
January 25, 2014, 04:27 PM

wow you are smart. this is a big problem on anki. I actually quit anki recently when i realised how terrible the developers were, their "upgrade" to 2.0 was essentially a downgrade. Pleco is all i use on a moblie device now. 

Ill try what you said with anki if its not too complicated. thanks for putting the word out.