Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re #REGEX
- import glob #Search files
- import fitz #PyMuPDF 1.14.2
- #REGEX
- pattern = "[a-zA-Z]"
- enList = glob.glob('./EN*')
- hrList = glob.glob('./HR*')
- wholeList = enList + hrList
- for file in wholeList:
- with open(file, "r+", encoding="utf-8") as f:
- with open(file+"CLEAN.txt", "a+", encoding="utf-8") as n:
- for line in f:
- if not re.match(pattern, line) == None:
- n.write(line)
Advertisement
Add Comment
Please, Sign In to add comment