Skip to content

Instantly share code, notes, and snippets.

View chrisgrieser's full-sized avatar

Chris Grieser chrisgrieser

View GitHub Profile
@chrisgrieser
chrisgrieser / metadata-refactor.sh
Last active December 31, 2023 02:19
Change Wikilinks in YAML Frontmatter from the Breadcrumbs style to the new Obsidian Metadata Style
# macOS
cd "path/to/your/vault"
awk 'FNR <= 1 && /^---$/{print FILENAME}' **/*.md |
xargs -I {} sed -i '' -E '1,/^---$/ s/(\[\[.*]])/"\1"/g' "{}"
# Linux (or macOS users with GNU sed)
cd "path/to/your/vault"
awk 'FNR <= 1 && /^---$/{print FILENAME}' **/*.md |
xargs -I {} sed -i -E '1,/^---$/ s/(\[\[.*]])/"\1"/g' "{}"