"Use sed to bulk edit Obsidian content"

I recently got asked about hacking #Obsidian Markdown files with sed. So here is an example that makes a global change to a tag across a whole vault.

USE WITH CARE. I hope this is a small learning example, it's definitely not a polished utility! Use at your own risk

https://alecthegeek.tech/blog/2022/12/use-sed-to-bulk-edit-obsidian-content/

#cli #ObsidianMD

Alec the Geek - Use sed to bulk edit Obsidian content

@alecthegeek For me, `sed` is a foot gun if there ever was one. 😅

I use it for years by now but I still find it obtuse. A few months ago I discovered `sd`, which aims to be a sane(r) alternative. I like it much more! https://github.com/chmln/sd

Also, `fd` (alternative to `find`)! https://github.com/sharkdp/fd

GitHub - chmln/sd: Intuitive find & replace CLI (sed alternative)

Intuitive find & replace CLI (sed alternative). Contribute to chmln/sd development by creating an account on GitHub.

GitHub

@alecthegeek Great article! Enjoyed the nostalgic video too.

It's possible to pipe highlighted text from within Obsidian to your shell and have the results replace what was highlighted.

I wrote two articles explaining how to do this:

1. How to send text to the shell
https://link.medium.com/cVfwSZf92vb

2. An improvement on the above to use a prompt with history (and no need to wrap the text)
https://link.medium.com/WqdhXmJ92vb

It's a joy to use shell commands in Obsidian!