Skip to content

Using Python to read a text file, and split into individual markdown files

Notifications You must be signed in to change notification settings

joelouthan/split_chapters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Splitting Chapters

Using Python to read a text file, and split into individual markdown files

The Details

I have a big honkin' file tmp.md that contains the entire 1689 Second London Baptist Confession in Markdown. Each of the Chapters are marked by # Chapter (Numeral). Using that marker, I wanted to divide each of the chapters into individual markdown files named 1689-(Numeral)-0-index.md.

I tried to do this in bash to no avail. Python seemed to be better suited to the task.