Skip to content

Instantly share code, notes, and snippets.

@pauldowman
Created September 17, 2021 22:22
Show Gist options
  • Save pauldowman/011ab93dc2a0a005b6801e56c5f865de to your computer and use it in GitHub Desktop.
Save pauldowman/011ab93dc2a0a005b6801e56c5f865de to your computer and use it in GitHub Desktop.
Kobo highlight exporter script
#!/bin/bash
KOBO_ROOT="$1" # The root of the mounted Kobo volume
HIGHLIGHTS_FILE="$2" # The output
sqlite3 "$KOBO_ROOT/.kobo/KoboReader.sqlite" << ENDSQL
.mode csv
.output $HIGHLIGHTS_FILE
.print "Title,Author,Date,Highlight"
select content.Title, content.Attribution, Bookmark.DateCreated, Bookmark.Text from Bookmark left join content on Bookmark.VolumeID = content.ContentID where Text is not null;
.quit
ENDSQL
@pauldowman
Copy link
Author

pauldowman commented Sep 17, 2021

This is a bash script to export Kobo highlights in a format that can be imported into https://readwise.io/

Usage example: export-kobo-highlights.sh /Volumes/KOBOeReader highlights.csv

Tested (not very much) on a Kobo Elipsa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment