Created
September 9, 2019 22:19
-
-
Save raelga/c9cd4c2f241d774de64b83a08234e03a 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 sys | |
import re | |
regex = r"^([0-9]+)\s+([0-9]{4}\-[0-1][1-9]-[0-3][0-9]-[0-2][0-9]:[0-6][0-9]:[0-6][0-9])\s+(\"[^\"]*\"|\w+)\s+(\"[^\"]*\"|\w+)\s+(\"[\w]*\"|\w+)$" | |
def dep(fildep): | |
deps = 0 | |
nodeps = list() | |
for line in open(fildep): | |
regdeps = re.search(regex, line, re.MULTILINE) | |
if regdeps: | |
nodeps.append(regdeps.groups()) | |
else: | |
deps += 1 | |
for nodep in nodeps: print(nodep) | |
print "Deps: %d" % deps | |
if __name__ == "__main__": | |
dep(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment