Created
October 13, 2013 14:42
-
-
Save tomkel/6963083 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/python | |
import csv | |
files = ['qb.csv', 'rb.csv', 'wr.csv', 'te.csv', 'flex.csv', 'dst.csv', 'k.csv'] | |
for fileName in files: | |
with open(fileName, 'r+') as file: | |
rows = [row[8:len(row)] for row in file] | |
if fileName == 'dst.csv': | |
for i in range(len(rows)): | |
row = str(rows[i]) | |
row = row[0:len(rows[i]) - 1] | |
players = row.split(',') | |
row = '' | |
for player in players: | |
row = row + player[player.rindex(' '):len(player)] + ' D/ST,' | |
rows[i] = row[0:len(row) - 1] + '\n' # remove comma | |
file.seek(0) | |
file.truncate() | |
file.writelines(rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment