47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
import io
|
|
import markdown
|
|
from re import search
|
|
import re
|
|
# import pypandoc and/or panflute
|
|
|
|
rootdir = "/Users/normrasmussen/Documents/Northpass/CustomerNotes/"
|
|
#meetingstart = "##"
|
|
#meetingend = "##"
|
|
#rx = r'{}.*?{}'.format(re.escape(meetingstart), re.escape(meetingend))
|
|
|
|
def findheadings():
|
|
headingsarray = []
|
|
with open(rootdir + "G2/G2.md", "r") as myfile:
|
|
file = myfile.readlines()
|
|
for headings in file:
|
|
if "##" in headings:
|
|
headingsarray.append(headings)
|
|
print(headingsarray)
|
|
|
|
def pullnotes():
|
|
date1 = "!*!"
|
|
#"[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4}"
|
|
date2 = "!@#"
|
|
#"[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4}"
|
|
#range = r'{}.*?{}'.format(re.escape(date1), re.escape(date2))
|
|
with open(rootdir + "G2/G2.md", "r") as myfile:
|
|
file = myfile.read()
|
|
print(file[file.find(date1)+len(date1):file.rfind(date2)])
|
|
#print(chunk)
|
|
|
|
def pullnotes2():
|
|
inRecordingMode = False
|
|
file = "rootdir + Talkspace/Talkspace.md"
|
|
for line in file:
|
|
if not inRecordingMode:
|
|
if line.startswith(r'\d+/\d+/\d'):
|
|
inRecordingMode = True
|
|
elif line.startswith(r'\d+/\d+/\d'):
|
|
inRecordingMode = False
|
|
else:
|
|
yield line
|
|
|
|
|
|
if __name__ == "__main__":
|
|
pullnotes()
|