Skip to content

Instantly share code, notes, and snippets.

@dropmeaword
Created January 22, 2013 20:04
Show Gist options
  • Save dropmeaword/4597932 to your computer and use it in GitHub Desktop.
Save dropmeaword/4597932 to your computer and use it in GitHub Desktop.
Export annotations from Kobo Touch ereader (assumes /media/KOBOeReader as the mountpoint)
#!/bin/sh
# ----------------------------------------------------------------------
# Extract the bookmark annotations from the Kobo database.
# ----------------------------------------------------------------------
kobodir=/media/KOBOeReader
db="$kobodir/.kobo/KoboReader.sqlite"
sqlite3 "$db" 'select VolumeID,StartContainerPath,Text,Annotation from Bookmark;' |
awk -F'|' 'BEGIN{OFS="|"}{gsub("/", "_", $1); print}' |
sort -t/ -k1 -k2 -n -k4 -k5 -k6 -k7 -k8 |
sed ' s/[^|]*|// s/[^|]*|// s/|/\n\n/ s/$/\n\n/ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment