Created
November 14, 2021 10:56
-
-
Save jckw/81537c608b4bc9d58af9887fbd871fb1 to your computer and use it in GitHub Desktop.
Rename Roam daily notes to Obsidian format.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import dateutil | |
import glob | |
# Assumes you're working in a directory with only the Daily Notes | |
# Files that aren't parseable dates will fail | |
files = map(lambda n: n[2:-2], glob.glob("./*.md")) | |
for f in files: | |
d = dateutil.parser.parse(f) | |
new_name = d.strftime("%Y-%m-%d") + ".md" | |
os.rename(f + ".md", new_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment