Import from BEAR App

Aha thanks @kaeros, I had neither installed :wink: I’m going to give it a try.

1 Like

I’ve updated the tool to understand multiple tags in the same line and also parse tags containing spaces if they follow the expected format of being enclosed in # characters.

I’m also trying to move from Bear to Obsidian, attachment doesn’t work from this post. I got something to fix that

import urllib.parse
import re
import os
for root, dirs, files in os.walk("./"):
    for file in files:
        if file.endswith(".md"):
          # f_base_name = urllib.parse.quote(os.path.basename(f_name))
          # print(f_base_name)
          f_path = os.path.join(root, file)
          p = re.compile(r"(.*)<a href.*>(.*.PDF)</a>(.*)", re.IGNORECASE)
          f = open(f_path, 'r+')
          file_contents = f.read()
          file_contents = p.sub(f'![[\g<2>]]', file_contents)
          f.seek(0)
          f.truncate()
          f.write(file_contents)

Thank you so much for building this tool, it worked beautifully for my migration from Bear to Obsidian. :slightly_smiling_face:

1 Like

Just wanted to say thanks for the git, would have thought obsidian might have had a simpler solution to export and import from bear.

It might not be easy for those who are new to terminal, brew, bundle, but it pretty much worked. I had an issue with a single exported note for some reason - just deleted that.

I think for your instructions, just add: copy {output] folder to Obsidian vault - for more clarity as to what to do (it sound duh, but sometimes we’re just not thinking) :smile:

Also had to do some update on ruby version, got that sorted out. Another error that came was related some feature being depreciated.

Hi! Recently I moved all my notes from Bear to Obsidian. During this, I found some helpful tips that will make the process faster and easier. So I decided to write a small step-by-step instruction that you could follow.

https://medium.com/@sashakryzh/how-to-move-notes-from-bear-to-obsidian-2fb4f62cdd72

If you have some suggestions please write them :slightly_smiling_face:

2 Likes