![]() |
|
Re-sorting Anki Decks Tip - Printable Version +- kanji koohii FORUM (http://forum.koohii.com) +-- Forum: Learning Japanese (http://forum.koohii.com/forum-4.html) +--- Forum: Learning resources (http://forum.koohii.com/forum-9.html) +--- Thread: Re-sorting Anki Decks Tip (/thread-6785.html) |
Re-sorting Anki Decks Tip - kodorakun - 2010-11-29 Hi All, If any of you have suffered through the pains of getting odd UTF-8 compliance errors with importing text files to anki, fear no more! I've had a lot of problems along these lines (despite explicit "conversion" to UTF-8 and "saving as" UTF-8 and all that). Here's my tip, demonstrated by example with the shared Anki Deck for 3000 kanji with tons of auxiliary information. This series of steps shows how to take the anki deck and re-sort it to display the cards in order of kanji frequency. 1) Download the anki deck, select all items and add a tag "original". 2) Export the anki deck as a tab-delimited text file, called "all_kanji_info-facts.txt" in this case 3) find your local linux machine (use Cygwin on windows, or a terminal on OSX/Linux) this is where it gets a bit sophisticated 4) make a "tab" delimiter variable. From the command line type " TAB=`echo -e "\t"` " (I'm putting the outer quotation marks apart from the command, leave those off but make sure to include the backwards single-quote and other double-quote in the command). 5) use the unix sort command. In this anki deck exported to text file the 14th column is for kanji frequency, so I will re-order the file based on this column with the following command: sort -t"$TAB" -n -k14 all_kanji_info-facts.txt > sorted.txt This command routes the re-sorted file to a text file called "sorted.txt". The sorting is done based on tab separation, by numerical value ("-n" option), and based on the 14th column of information ("-k14" option). Now import "sorted.txt" to the same anki deck you originally exported from, this way the fields are already there from the original card template. Add an extra tag to all imported items "sorted". Once the import is done either suspend or delete the original deck cards (done by selected all items tagged "original" and then deleting). IMPORTANT: when importing, if you have opted to only suspend your original deck instead of deleting, make sure you check the "tag facts with duplicate fields instead of deleting", otherwise you will get zero cards imported (because all the fields are identical! the only difference is the sorted order). I'm sure there is an easier way to do this (and that these instructions have been given somewhere else), but I was having tons of problems with character encoding and this option worked flawlessly for me. Here's the site I got the clue on using sort from: http://nsaunders.wordpress.com/2008/01/04/linux-tip-sort-a-tab-delimited-file/ Cheers! K. Re-sorting Anki Decks Tip - resolve - 2010-11-29 Download the 'reset creation times' plugin and you can do this within the card browser. Re-sorting Anki Decks Tip - kodorakun - 2010-11-29 Ha! That plugin sounds awesome. I googled around for creation time changing and ordering and sorting and only found vague references to things that weren't quite what I was looking for. Wish I found this plugin first! Everyone take note: this plugin is awesome. ![]() K |