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: