Created
January 6, 2017 14:40
-
-
Save GiacomoLaw/a9af9197762b5388af8a101db7d47c11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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/ / /g;s/"/"/g;s/<br>/\n/g;s:</p>.*$::' $SUB/content.html | head -n1` | |
sed 's/.*<p class="note_content">//;s/ / /g;s/"/"/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