Created
April 1, 2016 23:20
-
-
Save copyleftdev/7f0879ba85ce7d46667ba51417fe266c to your computer and use it in GitHub Desktop.
This file contains 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
import re | |
import os | |
import fileinput | |
import uuid | |
def getDocList(rootFoldr): | |
filelst = [] | |
for(dirpath, _, files) in os.walk(rootFoldr): | |
for filename in files: | |
filepath = os.path.join(dirpath, filename) | |
filelst.append(filepath) | |
return (filelst) | |
def textsane(rootFoldr): | |
flist= getDocList(rootFoldr) | |
pattern = re.compile("<([^>]+)>") | |
for each_file in flist: | |
for line in fileinput.input(each_file, inplace=True): | |
if not re.search(pattern, line): | |
print line | |
textsane('data') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment