sntools icon indicating copy to clipboard operation
sntools copied to clipboard

ENEX import tool ignores line breaks and bullet points

Open CR0CKER opened this issue 7 years ago • 9 comments

Importing notes from Evernote ends up removing line breaks, paragraphs and bullet points

CR0CKER avatar Feb 26 '17 07:02 CR0CKER

Just started trying out this tool and am running into the same issue. This is probably a roadblock for quite a few users switching from evernote to standard notes, as I write many notes with many line breaks, paragraphs, and most of all bullet points.

nickAtWybar avatar Jun 06 '17 01:06 nickAtWybar

Same here.. my line breaks are gone. I went to the Slack server of Standard Notes and it seems Evernote creates .enex files that carry HTML. Line breaks are in fact exported this way: <div>line1</div><div>line2</div>, which the ENEX import tool doesn't like. I'm currently trying to figure an alternate solution..

ElCoyote27 avatar Jun 14 '17 18:06 ElCoyote27

Small workaround that works for me on simple text notes:

  1. export your notebook to .enex from EverNote, take a backup copy. $ cp -a MyNotebook.enex.orig MyNotebook.enex

  2. Post-process your .enex using 'sed' and change </div><div> AND <br/> to a random string (I'm using WANAFOOBAR)

$ sed -i -e 's@</div><div>@WANAFOOBAR@g' MyNotebook.enex
  1. Process the resulting .enex on https://dashboard.standardnotes.org/tools

  2. Post-process the resulting evernote-to-sn.txt once more to replace WANAFOOBAR with '\n'

$ sed -i -e 's@WANAFOOBAR@\\n@g' evernote-to-sn.txt
  1. Import your Data Archive in Standard Notes.

ElCoyote27 avatar Jun 14 '17 19:06 ElCoyote27

@ElCoyote27 Thanks for responding back here - your post inspired some work between myself and a friend of mine to create a set of python scripts which convert Evernote notes --> standard notes Plus Editor. We took your code, converted it into Python, and made it for several cases - line breaks, bold, and unordered lists (these were my deal breakers for evernote import).

Flow: export.enex - convert_before.py - output pre_output.enex. take pre_output.enex, upload to standard note conversion tool - get evernote-to-sn.txt run convert_after.py on evernote-to-sn.txt

Consequently, my notes all have html tags in the plain editor, as I write mainly in bullet points (< ul > and < li > tags everywhere) In the plus editor it is a proper bulleted list. Another consequence is no real mobile reading, as mobile does not currently support plus editor.

However it's a workable solution for now, so glad I have switched now, so thanks!

nickAtWybar avatar Jul 04 '17 15:07 nickAtWybar

Hey @nickAtWybar, do you have a link to the Python script?

moughxyz avatar Jul 06 '17 17:07 moughxyz

I'd like a little more formatting preserved before running the converter tool myself.

Not sure what is working, feel free to check the boxes @mobitar:

  • [ ] Paragraphs & linebreaks
  • [ ] Lists (ul and ol)
  • [ ] Titles (h*)
  • [ ] Bold & italics
  • [ ] Formatted links

I'm assuming the note format should be Markdown.

Started using SN exclusively in June, just did my ENEX export from Evernote yesterday. Might be interested in fixing what's missing and sending a PR.

ErikBjare avatar Aug 16 '17 12:08 ErikBjare

Hey guys, I've been meaning to post those files, thanks for the prod @mobitar and @ErikBjare .

Erik, you can edit the 2 py files to correctly convert. Please note that this is for the Plus Editor of Standard Notes, not the simple editor.

Rough process:

  • export .enex. Must do each notebook on itself to get tagging right
  • change convert_before.py to accept the right incoming file
  • make sure .enex is in same folder as .py files
  • run convert_before.py
    • if it errors out because of charmap, go look in binary viewer to see where the offending hexadecimal pattern is (in enex file)
    • in sublime, replace that character with the correct one and save
    • certain characters are really finnicky!
  • take pre_output.enex and put in stdtool (standard notes enex converter online)
    • (output is evernote-sn.txt in same folder)
  • run convert_after.py

I'm a bit new to this, so hopefully this works for you guys: https://gist.github.com/nickAtWybar/d7129b379d15d6d7b89b9c12a00a1e7e

nickAtWybar avatar Aug 16 '17 17:08 nickAtWybar

@nickAtWybar Thanks for the script!

I will take a look but would prefer to see the "official" converter improve before resorting to non-userfriendly hacks.

ErikBjare avatar Aug 16 '17 18:08 ErikBjare

I think an Evernote to Markdown converter might be a good tool to add to this toolchain. Currently the converter only preserves newlines and paragraphs since the default editor is plaintext, and things like bold and italics can't be properly expressed.

moughxyz avatar Aug 16 '17 18:08 moughxyz