Another solution is to place multiple cursors (alt
+click) on each header, go to the beginning of the line using the keyboard key Home
and hit #
to demote, or hit Delete
to promote!
You can also create the multiple cursors with more ease using Advanced Cursors (Obsidian Store, GitHub).