View Single Post
Old 12-30-2011, 07:15 PM   #16
fei-d
Member
fei-d is on a distinguished road
 
Posts: 14
Karma: 50
Join Date: Jan 2010
Device: Sony PRS 505
I just tried your code, but it did not work...

The cygwin terminal just gave me the "-bash: ./sqlite3.exe: No such file or directory" message again.

So I changed this part of the code, just like opitzs has described earlier, and it worked again.

For example, I currently read Viktor Frankl's "Man's Search for Meaning" and extracted some of the highlightings I took. I attached the "quotes.txt" document to this post, so that one can see this 200 character limit.

This is the code I successfully used:

Code:
	#!/bin/bash
	OUTPUT_FILE='quotes.txt'
	SQLITE='sqlite3'
	AWK='awk'
	
	#add the UTF-8 BOM to the generated file
	echo -ne '\xEF\xBB\xBF' > $OUTPUT_FILE
	$SQLITE Sony_Reader/database/books.db 'select b.author, b.title, a.marked_text FROM annotation a INNER JOIN books b on a.content_id=b._id' | \
	$AWK -F '|' '{ print "--------------------\nAuthor: "$1"\nTitle: "$2"\n--------------------\n"$3"\n--------------------" }'| \

unix2dos >> $OUTPUT_FILE
Attached Files
File Type: txt quotes.txt (7.9 KB, 597 views)
fei-d is offline   Reply With Quote