Skip to content

Instantly share code, notes, and snippets.

@jjam3774
Created November 2, 2013 05:20
Show Gist options
  • Save jjam3774/7275826 to your computer and use it in GitHub Desktop.
Save jjam3774/7275826 to your computer and use it in GitHub Desktop.
Url Count
#!/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