Created
May 7, 2020 18:25
-
-
Save dtjohnso/cfbdbffd53cebac3d569eae94815616c to your computer and use it in GitHub Desktop.
Split a Markdown file into separate files at the ## h2 heading
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
# A script to split a .MD file into chunks, separating on h2 ## headings | |
# Duncan Johnson | |
# csplit test.md -f 'ch' --suffix-format='%03d.md' "/^## /" "{*}" -s | |
csplit $1 -f 'ch' --suffix-format='%02d.md' "/^## /" "{*}" -s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
im a dummy, been trying to do this in terminal on mac osx - no luck, thoughts?