Just in case it’s ever helpful for someone trying to do the same thing I thought it might be helpful to record the procedure I’ve finally adopted for importing into DT entries from my Day One journal.
The result of the procedure are single markdown files which preserve the original Day One data and which are each named with the date of the entry.
The problems
Day One enables export of entries in JSON, pdf, HTML and plain text/markdown formats. The difficulty is that when you select multiple entries the result is a single file containing all the entries.
It is possible to export to JSON and convert to single markdown entries by using the Bear app but you do lose some useful Day One data in the process (for example, the date, location and weather headings for each entry). Further some markdown does not survive that process (tables, for example).
What you will need
In Finder create a folder dedicated to receive the entries exported from Day One. I’ll call that the Journal Folder.
You need a terminal command, (which I’ll call the Terminal Command) which looks like this:
split -p ‘^ Date:’ journal.txt out
Don’t omit the single quotation marks and note that there is tab before “Date:” You enter that in Terminal by typing Ctrl+V and then pressing the tab key.
You will be batch renaming files in Finder so make sure you know how to do that. (I use ForkLift which makes that a little easier.)
The procedure
- In Day One select the entries you wish to export and import into DT.
- Export those entries as plain text/markdown into the Journal Folder. For the purposes of this post I’ve called the file you create journal.txt.
- The export will create a zip file so extract from it the journal.txt file and any photo folder.
- Open Terminal, navigate to the Journal Folder and then run the Terminal Command (which will split the journal.txt file into individual entries for each date).
- In Finder go to the Journal Folder, delete the journal.txt file and select all of the other files in the folder (save for any photo folder). Batch rename those files to add the .md extension.
- In DT select the folder into which you wish to import the journal entries, open the Journal Folder and import all entries from it (including any photo folder).
- In DT select all the imported markdown files (i.e., excluding any photo folder), go to Tools > Batch Process and choose “Change Name” to “Oldest Document Date” (which will pick up the creation date of each entry).
- If any entry has a photo attached to it you will need to ensure you are in edit mode (rather than preview mode) for that entry, delete the old link and then drag the relevant photo into the entry to create the correct link in DT.
Disclaimer
I am no great expert and am sure it’s possible to improve this procedure. However, the procedure is the best way I have discovered of preserving all Day One data and markdown in DT.
Although the process sounds rather convoluted it’s not at all bad once you get the hang of it. For example, if you leave open the Terminal window all you need to do (if you’re exporting multiple batches of entries) is, on each occasion, to press the up arrow key to recall the Terminal Command.
Stephen