Created
November 2, 2013 05:20
-
-
Save jjam3774/7275826 to your computer and use it in GitHub Desktop.
Url Count
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
def main(): | |
command = "cat foo.txt| rev | cut -d\. -f1,2 | rev | sort | uniq -c" | |
print("________________________Results_____________________________") | |
for i in os.popen(command).readlines(): | |
a = i.split() | |
print("The total url count for {0} is: {1}".format(a[1],a[0])) | |
return 0 | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment