Back

How do I import RevTK stories into Anki? 2011 Edition

#1
I've just spent 4 hours on the forums trying to find how to import my RevTK stories into Anki. Unfortunately nearly everything is from 2-3 years ago, and a lot has changed, both at RevTK and for Anki. I'm really hoping someone can please help me here because I feel like I'm on the verge of a mental breakdown after having tried every possible iteration I could dig up.

So far, I do this:

-Export RevTK files from using Manage->Export
-Start up Anki
-I have already installed both plugins (one imports .txt files, the other .csv from Koohii), have disabled the syncing options and the save at closing options, as the instructions in the plugins and on these forums say
-Open up a deck of Heisig's RtK1 (because I've only gotten that far)
-Go to import, change the file type to the plugin's Koohii .csv file, select the exported RevTK file, then click import.
-Anki freezes for a sec like the instructions say it will, but then it gives me this error message:

Import failed.
Traceback (most recent call last):
File "ankiqt/ui/importing.pyc", line 203, in doImport
File "/Users/Xander/Library/Application Support/Anki/plugins/Import progress from Koohii (see descrip.py", line 194, in doImport
File "/Users/Xander/Library/Application Support/Anki/plugins/Import progress from Koohii (see descrip.py", line 161, in process_deck
AttributeError: 'Deck' object has no attribute 'rebuildQueue'


And that's as far as I've gotten. I have no clue how to use Sqlite or Python or any time of programming whatsoever. All I'd like to do is fix this import bug. Could somebody please help me? Not only would it help me, but with all the new plugins and such, it would be good to have a more updated guide. Thank you so much!

*Edit* And yes, I just saw that little message at the top about Anki help, but I've searched that as well and can't find any help. I'll post for help in there too, but I'm really hoping someone here can just help me out...omg I am so upset right now ahhhhhhh
Reply
#2
Email the plugin author and ask them to update the plugin for Anki 1.2, or do the import on Anki 1.0 and then upgrade.
Reply
#3
No good. I deleted my Anki and installed a 1.0 version. However that version wouldn't even let me download or add any Anki sets; instead it would spit out a long error message =/
Reply
May 16 - 30 : Pretty Big Deal: Save 31% on all Premium Subscriptions! - Sign up here
JapanesePod101
#4
Kokichi Wrote:No good. I deleted my Anki and installed a 1.0 version. However that version wouldn't even let me download or add any Anki sets; instead it would spit out a long error message =/
You can download an older version (1.0.1). That might be worth a try: http://ankisrs.net/#windows

I would like to know how this goes because I would like to do the same.

cheese.
Reply
#5
This might be too basic for what you want to do, but it might help if you want only to add stories to an existing deck (without study progress info). There's a new import 'update' feature in import.

- Create a new story field in the Anki deck if there isn't one already.
- Take a look at the RTK csv file to see which field # your stories and the kanji are in.
- Associate the csv story field with the Anki deck story field.
- Click the "update" instead of the "import" button at the end.
- It'll ask you to associate the unique matching field (which will be Kanji).

You can do this for multiple fields at once if there's other useful stuff (changed keywords now?) I think Fabrice's export puts stories in " " so story commas won't confuse things. Make sure the text file is saved as UTF 8.

Update is useful for people who want to add vocab or Japanese keywords.
Reply
#6
Boy Pockets, I tried that (Mac) but that 1.0.1 was the one that was giving me even more error messages than before, not even allowing me to add any decks.

I get the error message:

Unable to read file.

/Users/Xander/Documents/Anki/my_stories.csv:1: Unexpected format of status file

When I try to use the import .csv option from the plugin. I would use the import as text option that's default to Anki, but unfortunately the .csv file made by Koohii, like you said Thora, is separated in a different manner so as to be incompatible with Anki. And I don't quite get your guide...how do you associate the csv story field with the Anki deck story field? Also, not all of my kanji have stories for them (especially the first ones which are pretty easy to remember as is). Because there are no stories, there is no entry in the export file. I would need to find a way to somehow match the kanji in Anki with the kanji that have stories in the export file.

I really wish someone would just make this simple...it's 2011 already and it'd be great to be able to use Anki to help me study for the JLPT N2 this summer...
Reply
#7
Misread label, I couldn't import stories, I had to delete them to import PROGRESS which was annoying, but got the job done.........
Edited: 2011-02-07, 4:38 pm
Reply
#8
If you are starting from scratch, you can export to CSV and import from there.
This probably doesn't apply to many people though.
Reply
#9
Kokichi Wrote:I would use the import as text option that's default to Anki, but unfortunately the .csv file made by Koohii, like you said Thora, is separated in a different manner so as to be incompatible with Anki.
Anki will import csv (even though only semi-colon and tab are listed if that's what you mean).

I just tried it...the one story that didn't import had paragraph breaks or something. If that's the problem, try removing them or replacing them with line breaks. (eg \p → \l , depending on your editor).

Quote:Also, not all of my kanji have stories for them [...] Because there are no stories, there is no entry in the export file. I would need to find a way to somehow match the kanji in Anki with the kanji that have stories in the export file.
The update feature is to let you fill in or update fields of any number of cards in an existing deck with new data. In other words, the new data doesn't have to be in a complete set of items. All you need is a unique field to match what's there.

Hope you can get it done...you sound frustrated.

Quote:And I don't quite get your guide...how do you associate the csv story field with the Anki deck story field?
The RTK export file "my-story" (csv text file ) has the following fields:
1. Heisig Number
2. Kanji
3. Keyword
4. ?
5. Date
6. Story

The Anki RTK deck I downloaded, for eg, has the following fields:
Kanji
Keyword
Stroke count
Heisig number
Lesson number
On-yomi

*File - Import - Select the my-story file.
*The 6 my-story file fields will be displayed. Map/associate them with the corresponding deck fields, as needed. (You need at least the story field and a unique field - could use kanji or number in this case.)
Field 1 ----> Heisig Number
Field 2 discard
Field 3 discard
Field 4 discard
Field 5 discard
Field 6 ----> Story
*Click "Update"
*Select the unique matching field:
Field in File: Field 1
Field in Deck: Heisig Number
Edited: 2011-02-07, 7:56 pm
Reply
#10
When I was doing RtK I used a custom script I wrote that downloaded the export csv from revtk, updated the stories by matching against the heisig number, did some formatting conversion to get the same look (eg, automatically bolding the keyword, converting asterisks to html tags, etc), and unsuspended the cards.

When learning, I would:
1) scan RtK to see if Heisig had some important notes or introduced a new primitive
2) scan a spreadsheet someone made of recommended unofficial primitives
3) use RevTK to add stories until I ran into a new primitive and had at least 10 done
4) run ./update to update my deck with the new stories I made
5) review in anki (sometimes with a 1min delay to get a drink, listen to a song, etc)
6) repeat

which was drastically faster than my previous method where I manually inputted new stories into anki and reformatted them by hand.

I haven't run it against the latest anki but I'll try to update it and make it into a plugin tonight. Also, the source is on github if anyone wants to play with it.
Reply
#11
I can't even get that far. Whenever I try to import the csv file I keep getting the error message

Unable to read file.

/Users/Xander/Downloads/my_stories.csv:1: Unexpected format of status file

I wonder if it's because I'm using a Mac...Googling the error message gave me this link to another forum post here

http://forum.koohii.com/showthread.php?p...5#pid38235

Where the last post is a guy asking for help, same as me. I'll try installing Anki on my Windows partition, but I don't see why that would matter...

*Update* Yup, it was the Mac causing the problem. I installed Anki on Bootcamp, ran it in Parallels, and when I go to import everything works out fine. It wasn't syncing before either, which I'm going to venture is another Mac issue.
Edited: 2011-02-08, 12:59 pm
Reply
#12
Glad you got it to work. Was it the plugin that you used? Does it transfer progress data too? Overture's fancier automatic reformatting options sound useful too.

btw, if it's a mac issue with Anki's default import, maybe post it over at Anki so Resolve can look into it?
Reply
#13
It's a plugin error rather than an error in Anki itself
Reply
#14
Thora, thanks so much for your guide! I finally got it to work by using my Windows version of Anki! I've now synced everything online and to my iPhone, and am ready to study for the JLPT2! Softbank service here in Japan sucks so I really needed something that would allow me to study offline. Thanks so much, I really appreciate it! 助かれました!
Reply
#15
Hello,

I would like to make an addendum to the guide.

When you download the story CSV file for Anki, you may want to properly convert the italics and bold keywords. RTK uses the * and # characters to italicize and bolden respectively, whereas Anki uses the <em> and <strong> HTML tags.

Changing them one by one is an arduous task if you have over 50 stories to convert. So in order to change them painlessly:

Open the CSV file with Notepad++
Click the 'Search' menu, then on the 'Replace' function.
In the dialog box:
Check regular expression for the search mode
Find what: \#(.*?)\#
Replace with: <strong>\1</strong>
Then click 'Replace All'.
Then change the fields in the same dialog box:
Find what: \*(.*?)\*
Replace with: <em>\1</em>
Then click 'Replace All'.

Save as a copy of your stories and not over the original.

Now all of your RTK stories have their keywords properly displaying in Anki.
If something goes awry after, the odds are that you have a stray * or # character in one or more of your stories. Find where the problem began, note down the Heisig number, then go back to the original CSV file at the specific Heisig number and remove the stray character. Repeat the conversion process above.
Reply
#16
Sigh.... I am having the same problem as the OP... exported JUST THE KANJI (not my stories) to .csv from koohii.... but I can't seem to import ANY .csv files into Anki at all.... if I convert to .txt and import it works, but I'd like to fix this problem.

I'm on a Mac and as I don't use Windows that isn't a solution Smile


I'm doing this to use the "progress" plugin, but that's irrelevant here as I can't import the .csv file no matter what I use or what I am doing.

Please help lest I jump off a cliff. And I live in Texas, so it'll take me a while to get to one, and gas is expensive.
Reply
#17
homie, rtk is just the beginning of this journey. less than 5%. don't sweat over kanji... find a anki kanji deck and add stories to the ones you are having problems with exclusively. if you're not done, write your new stories in anki from this point forward.

you'll only need to see each story a handful of times again in your life if you're using anki correctly... many kanji are obvious and won't need you to transfer.

for all the energy you're using now you could have been done copy-pasting already.
Reply
#18
Probably. I'm an expert in useless flailing Wink

That said, I have a new version of the plugin to upload review practice into Anki from koohii, which works on a mac. Nevar, the author of that plugin, is waiting for the info needed to upload the new version to the Anki plugin space.

In the meantime, if you're having an error it could first be due to a weird errant character in your .csv file, as was my case, or if you're on a mac it could be you need this new version of the plugin. Msg me if you want it!
Reply
#19
Hey,

New version of "Import progress from Koohii" plugin available in Anki download.
* Fixed "Unexpected format of status file"

Sometimes it throws an error :

Import failed. Traceback ...
...
AttributeError: 'Deck' object has no attribute 'rebuildQueue'

If it does, just click the import button again. Seems to work with my tests. I didn't code the original plugin, but if I have time I might look at what's causing this error.
Edited: 2011-12-05, 4:33 am
Reply
#20
Yep, the author was able to upload the new version today. Yay!
I had the same situation- if importing throws an error the first time, just hit the button a second time and it should work.
Reply
#21
I have a couple of problems importing my stories and progress and was hoping for a little help. For reference Im using.

Anki 1.2.8 on Win7

The deck I downloaded is : Heisig's Remembering the Kanji 1+3 with 2010 joyo kanji

I have the latest version of the "Import progress from Koohii (see description for updates)" plug in which was update as of I think december 5th 2011

I have exported the two files from the RevTK website (my_stories and rtk_flashcards)

One thing which might be throwing a bit of a spanner in the works. I have finshed RTK1 and the recent joyo suppliment but NOT the remainder of RTK3 (bar one or two non joyo ones I added) so my personal deck is 2196 of a total 3029 kanji.

The two problems I have are

1 - when I import my stories everything works fine for the RTK1 stories but the RTK3 and RTK suppliment kanji have no stories in spite of the "my_stories" file showing complete entries. This is a quick sample of the content of the file incase it is helpful.

Code:
2797,餌,"feed",0,2011-12-05 21:16:15,"FOOD made of EARs is animal Feed"
2802,餅,"mochi",0,2011-12-06 20:42:18,"Mochi is strange FOOD, im PUZZLEd why people like it."
2839,麓,"foot of a mountain",0,2011-12-11 19:40:12,"at the Foot of the Mountain is a GROVE filled with DEER"
I suppose I could manually add these stories to anki but im sure there is an easier way.

2 - When I try to import my progress from the rtk_flashcards file everything looks like it is working but the import finishes with the following message

Code:
Importing complete. 0 facts imported from rtk_flashcards.csv.
Log of import:
Progress information for 2196 cards loaded.
Processing 1 cards...
Skipped frame #1 -- not present in deck.
Skipped frame #2 -- not present in deck.
Skipped frame #3 -- not present in deck.
Skipped frame #4 -- not present in deck.

-snip-

Skipped frame #3029 -- not present in deck.
Skipped frame #3030 -- not present in deck.
0 cards modified, 1 cards skipped.
Progress update complete.
Im really rather confused, anyone have any ideas?!
Reply
#22
Hi, just wondering if anyone else is having this problem with Anki 2.0......

I used to be able to import my RevTK mystories.csv file into Anki so that my Anki cards (from the generic Heisig shared deck) had my personal stories, keyword changes, etc in it.

I USED TO use the following instructions, taken from elsewhere in this thread:

----------

The RTK export file "my-story" (csv text file ) has the following fields:
1. Heisig Number
2. Kanji
3. Keyword
4. ?
5. Date
6. Story

The Anki RTK deck I downloaded, for eg, has the following fields:
Kanji
Keyword
Stroke count
Heisig number
Lesson number
On-yomi

*File - Import - Select the my-story file.
*The 6 my-story file fields will be displayed. Map/associate them with the corresponding deck fields, as needed. (You need at least the story field and a unique field - could use kanji or number in this case.)
Field 1 ----> Heisig Number
Field 2 discard
Field 3 ----> Keyword
Field 4 discard
Field 5 discard
Field 6 ----> Story
*Click "Update"
*Select the unique matching field:
Field in File: Field 1
Field in Deck: Heisig Number

----------

......but NOW, it doesn't want to work. I can't figure out if the Fields are in different places because the decks got upgraded to be compatible with 2.0, etc.

I use LibreOffice Calc, make sure to save the mystories.csv into UTF-8 encoding and as a .csv, anything else I should be tweaking?

In the Anki 2.0 import box, there's also an option to choose what the items are separated by- since RevTK exports to .csv, does that mean the items, for Anki's purposes, are indeed separated by commas? As opposed to tab, semicolon, etc.....spreadsheets, yeah, I don't understand them! Wink

How does one read the mystories.csv file to determine which fields are where to see if they're different from before? It's kind of gibberish to me when I open it in Libre, I'm not very familiar with spreadsheet programs. is there a place to look within the program to determine this?

When I try to import it as I had done many times in the past, Anki pops up a box saying "The first field of the note type must be mapped.".....but I already mapped Field 1 to the Heisig Number, as the instructions above instruct to, and as has worked in the past. What else can I do? Am I mis-understanding what "The first field of the note type must be mapped." means?

Thanks in advance for any help, I'd like to think I know my way around my favorite programs, but this has me stumped!
Reply