View Single Post
Old 11-29-2015, 12:25 PM   #3
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,828
Karma: 169712582
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by kwokhin View Post
HOW CAN I EXPORT MY NOTES?
I wouldn't have asked for help if I had not tried to figure it out first. But I really couldn't do it. PLEASE HELP!
I took a quick look at the method you were using and with some minor changes, it worked for me.

work.cmd (same as work.bat, the %~dp0 just points to directory file is run from)

Code:
%~dp0sqlite3.exe KoboReader.sqlite <extr_annotations.txt
extr_annotations.txt (modified to insert \r\n instead of rn for new line and use annotations.txt instead of annotations.doc)

Code:
.output annotations.txt
.separator \r\n
 SELECT VolumeID, Text, Annotation
 FROM Bookmark;
.exit

I copied sqlite3.exe and the sqlite database from my H2O into the directory and after running, I had the annotations.txt file.

OTOH, my personal preference for extracting annotations which was also somewheres on Mobileread a while back used a single batch file with a rather long command line to do the extract from the database on the Kobo itself, doing some cleanup on the results and leaving them in the same directory as the .cmd file in a file called annotations.html. Basically, just need extr_annotations.cmd and the sqlite3 executable in a directory and the Kobo ereader connected (for me, the internal storage mounts as drive E: so if yours mounts in a different spot, you'll need to change that ( E:\.kobo to whatever:\.kobo ). The pause at the end of the batch file just keeps the DOS box open so I can see any error messages.

extr_annotations.cmd

Code:
%~dp0SQLite3.exe "E:\.kobo\KoboReader.sqlite" "select (case when datecreated=maxdate then ('<b><i><u>' || replace(volumeid,'file:///mnt/onboard/','') || '</u></i></b><br />') else '' end), max(datecreated, coalesce(datemodified, 0)), text, coalesce(annotation, '') || '<br />' from ( select *, (select max(datecreated) from bookmark where volumeid=bm.volumeid and (text<>'' or annotation<>'')) maxdate from bookmark bm where (text<>'' or annotation<>'') order by maxdate desc, volumeid, datecreated desc )" > "%~dp0annotations.html"

pause

Last edited by DNSB; 11-29-2015 at 07:44 PM.
DNSB is offline   Reply With Quote