Created
June 20, 2011 04:59
-
-
Save nicolas-raoul/1035149 to your computer and use it in GitHub Desktop.
A script to grep through an Anki deck
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Search for a term within an Anki deck. | |
# | |
# Usage: grepdeck.sh somedeck.anki someword | |
# | |
# You might want to add such an alias to your .bashrc : | |
# alias gdj='~/programs/grepdeck.sh ~/decks/japanese.anki' | |
# Then usage becomes for instance: gdj 仕組み | |
DECK=$1 | |
WORD=$2 | |
sqlite3 $DECK 'select question, answer from cards' | sed 's/<\/\?span[^<>]*>//g' | grep -i $WORD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment