Created
July 11, 2016 23:04
-
-
Save IanMulvany/71d832a84c7ca2d5c609401401ee231a to your computer and use it in GitHub Desktop.
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
from glob import glob | |
def get_note_title(filename): | |
title = filename.split(".")[0] | |
return title | |
files = glob("nv-bear-import/*") | |
for f in files: | |
title = get_note_title(f.replace("nv-bear-import/","")) | |
with file(f, 'r') as original: data = original.read() | |
with file(f, 'w') as modified: modified.write("# "+title+"\n" + data) | |
print "rewrote " + f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment