Created
February 9, 2015 20:14
-
-
Save fcrespo82/76471af04b98e98fdadd to your computer and use it in GitHub Desktop.
Script to count quotation marks in jsp
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 os | |
import re | |
with open("/home/fxcrespo/workspaces/workspace_siga/count.log", "w") as thelog: | |
for path, dirs, files in os.walk("/home/fxcrespo/workspaces/workspace_siga"): | |
for thefile in files: | |
thepath = os.path.join(path, thefile) | |
if thepath.endswith("jsp"): | |
thecount = len(re.findall("\"", "".join(open(thepath).readlines()))) | |
if thecount > 0 and (thecount % 2 != 0): | |
print(thepath, thecount) | |
thelog.write(thepath + " - " + str(thecount) + "\n") | |
break | |
#if len(files) > 120: break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment