Created
November 8, 2010 05:20
-
-
Save emilepetrone/667412 to your computer and use it in GitHub Desktop.
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
| import csv | |
| import sys | |
| import binascii | |
| filename = "analytics.csv" | |
| analytics = csv.reader(open('../script/analytics.csv', 'r')) | |
| try: | |
| for row in analytics: | |
| if row[0].startswith('/?h='): | |
| # if len(row[0]) % 2 == 1: | |
| # print 'ODD line %d' % analytics.line_num | |
| words = row[0].lstrip('/?h=') #grab the hex word | |
| word = binascii.unhexlify(words) | |
| print 'Line %d: decoded message is ' % analytics.line_num , word | |
| except csv.Error, e: | |
| sys.exit('file %s, line %d: %s' % (filename, analytics.line_num, e)) | |
| # lines 69 & 203 were odd, added 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment