Skip to content

Instantly share code, notes, and snippets.

@emilepetrone
Created November 8, 2010 05:20
Show Gist options
  • Select an option

  • Save emilepetrone/667412 to your computer and use it in GitHub Desktop.

Select an option

Save emilepetrone/667412 to your computer and use it in GitHub Desktop.
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