Created
March 5, 2012 10:19
-
-
Save kgleeson/1977753 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 | |
text = csv.reader(open('evoreg.csv', 'rb'), delimiter=';') | |
idList = ['Name', 'Boards', 'Age', 'Email', 'Games', 'Date'] | |
for row in text: | |
gamesList = row[5].split(',') | |
print '='*80 | |
for id, data in enumerate(row[1:7]): | |
if not id == 4: | |
print '%-10s : %s' % (idList[id] , data) | |
else: | |
for i in gamesList: | |
if i is gamesList[0]: | |
print '%-10s : %s' % ('Games', i) | |
continue | |
if len(gamesList) > 1: | |
print '%-10s : %s' % ('', i) | |
idDict = {1:'Name', 2:'Boards', 3:'Age', 4:'Email', 5:'Games', 6:'Date'} | |
for row in text: | |
gamesList = row[5].split(',') | |
print '='*80 | |
for id in idDict: | |
if not id == 5: | |
print '%-10s : %s' % (idDict[id] , row[id]) | |
else: | |
for i in gamesList: | |
if i is gamesList[0]: | |
print '%-10s : %s' % ('Games', i) | |
continue | |
if len(gamesList) > 1: | |
print '%-10s : %s' % ('', i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Take:
"7";"Farzad";"antigirl";"27";"[email protected]";"SSF4AEv2012,SFxTEkken Teams,uMVC3,Mortal Kombat";"26-02-2012";"z5tylcu07434ct0z03v";"0"
Output: