Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#Import Google notes to Evernote
#!/bin/bash
# Must be run in the folder containing the desired Google Notes backup
BASE=/tmp/gnotes
rm -Rf $BASE
IFS=$'\n'
for N in `find ./ -maxdepth 1 -mindepth 1 -type d `
do
FOLDER=$N
mkdir -p $BASE/$FOLDER
for SUB in `find $N/ -mindepth 1 -type d`
do
TITLE=`sed 's/.*<p class="note_content">//;s/&ensp;/ /g;s/&quot;/"/g;s/<br>/\n/g;s:</p>.*$::' $SUB/content.html | head -n1`
sed 's/.*<p class="note_content">//;s/&ensp;/ /g;s/&quot;/"/g;s/<br>/\n/g;s:</p>.*$::' $SUB/content.html > $BASE/$FOLDER/$TITLE.txt
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.