-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStep2_NoteCheck.py
More file actions
15 lines (14 loc) · 838 Bytes
/
Step2_NoteCheck.py
File metadata and controls
15 lines (14 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os
#from itertools import groupby
#Assign folder to variable 'directory'
#Open the variable 'directory' and display EACH .txt files as a list with no spaces
#This will ONLY be visible from the CMD line and will not affect the ACTUAL document.
#This is a good way to see where there are any notes and how they are being processed.
#Use this to see what files contain notes and seperate them to deal with later (If multiple lines exist or characters you do not want)
directory = 'C:\\path\\to\\folder'
for file in os.listdir(directory):
if file.endswith(".txt"): #Skip non-TXT files
with open(os.path.join(directory, file), "r") as f:
nameList = [line.strip() for line in f]
print(nameList)
print('###################################################################')