How to import multiple ENEX into one notebook?

Operating system

Linux

Joplin version

2.14.22

Desktop version info

Joplin 2.14.22 (prod, linux)

Client ID: 30e0fbad9d794304b85d7df8776cae4f
Sync Version: 3
Profile Version: 46
Keychain Supported: No

Revision: e579eb9

Advanced Tagging Rules: 1.4.0
Backup: 1.4.0
Favorites: 1.3.2
Quick Move: 1.1.0

Sync target

Dropbox

What issue do you have?

I need to import several ENEX backed up via CLoudHQ from a folder into a single Notebook (or at least be able to mass-move them and then mass-delete notebooks, although this isn't ideal as I have hundreds of notes.) For some reason it insists on putting each note into an individual notebook titled by the item's name, and it isn't letting me opt to select notebooks or tags when mass-importing... It's a great app and I have no other problems, this (or my lack of knowledge of how to circumvent this?) prevents it from being perfect.

The enex format doesn't have support for notebooks, just notes. This means that in order to export from Evernote you export each notebook as its own enex then import them again one by one into Joplin.

If you need to import them into a single book then your best bet might be to manually edit the .enex files - they are just plaintext XML but that is probably just as much effort as doing it all one by one.

I run Linux and can't export the notebooks, that's why I'm using cloudhq and paying big money for something that should be free (and was before they killed legacy- it ran under WINE. That's one of the reasons why I'm going to Joplin in the first place.) Help... :cry: is there a workaround?

The problem isn't the export, it would be the same if it was natively exported. Joplin isn't expecting there to be anything other than one notebook per .enex.

As mentioned, if you don't want to do it manually in Joplin then you are probably looking at merging the enex files. Either that or see if there is another application that can import all your enex files then output as markdown or html.

Do you think it could be done via Linux terminal CAT?

Do you happen to have a test ENEX notebook file (or two) I can pull apart to see the format? I'm fairly confident that if I can compare the format, I can convert via a Linux script or something. I'm not a super tech, but I've made really simple custom Linux scripts before.

You can find a couple of simple examples in one off the Joplin tests dirs - joplin/packages/app-cli/tests/enex_to_md at dev · laurent22/joplin · GitHub - you can see they are just plain XML. The main thing is that each note is contained in its own set of <note> </note> tags and you just add extra ones in.

One possible approach would be to import all these ENEX files into a new profile (File => Profiles). That will create many notebooks, but you can go to "All notes" to see all the notes. Then you can select them all and move them all to a single notebook that you create. Once done you can export that notebook to a JEX file, and import it back into your main profile.

2 Likes

That would actually be brilliant.

I did find a gnome terminal CAT + text editor bulk find & replace method that works pretty well; I may post it in a while once I perfect it.

Or maybe if I have time try to rig it into some sort of ugly but functional script.

This is ugly and will offend true code nerds, but hey it worked.

How to manually combine several Cloudhq Evernote ENEX note exports into one notebook export for import into Joplin, etc.

#####1.

run 

cat * > all.enex

#####2.

CTRL + REPLACE with nothing (delete) every instance of 

<?xml version="1.0"?>
<!DOCTYPE en-export PUBLIC "SYSTEM" "http://xml.evernote.com/pub/evernote-export2.dtd">

#####.3 

CTRL + REPLACE with nothing (delete) every instance of 

<en-export>

and 

</en-export>

EXCEPT THE VERY LAST </en-export> at the end!


#####.4 

ADD THIS (or something similar) TO THE TOP OF THE FILE

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export2.dtd">
<en-export export-date="20240704T050542Z" application="Evernote/Windows" version="6.x">
2 Likes

Thats all that matters!