Skip to content

Instantly share code, notes, and snippets.

@austinjp
Last active October 6, 2015 12:20
Show Gist options
  • Save austinjp/d8f4488ba669f37ee450 to your computer and use it in GitHub Desktop.
Save austinjp/d8f4488ba669f37ee450 to your computer and use it in GitHub Desktop.
#!/bin/bash
# As per http://steady.org/2013/06/19/exporting-evernote-notes-to-plain-text-files-part-1/
# First, check how many Evernote notes you have. You need to know that number.
# Rename your .enex file to evernote.xml
# Create a tidy.conf file that looks something like this:
# output-xml: yes
# input-xml: no
# add-xml-decl: no
# add-xml-space: yes
# char-encoding: utf8
# input-encoding: utf8
# output-encoding: utf8
# indent: yes
# indent-attributes: yes
# indent-spaces: 2
# indent-cdata: no
# fix-uri: no
# fix-backslash: no
# drop-empty-paras: no
# anchor-as-name: no
# repeated-attributes: keep-last
# error-file: tidy.err
# wrap: 0
# wrap-sections: no
# wrap-script-literals: no
# markup: no
# quote-marks: no
# quote-nbsp: no
# quote-ampersand: no
# preserve-entities: yes
# merge-divs: no
# lower-literals: no
# literal-attributes: yes
# Tidy up that XML:
tidy -config tidy.conf -o tidy.xml -xml evernote.xml
# Last number here should be the number of notes you have, minus one.
csplit -f file -n 4 tidy.xml /\<note\>/ {609}
# Tidy up the individual XML files:
tidy -config tidy.conf -xml -m file0*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment