Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. countrow = 0
  2. with open('mysheet.csv', newline='') as csvfile:
  3. thesheet = csv.reader(csvfile, delimiter=' ', quotechar='|')
  4. for row in thesheet:
  5. for mystring in row:
  6. shred = mystring.split(",")
  7. for x in range(0,8):
  8. matrix[countrow][x] = shred[x]
  9. countrow = countrow + 1
  10.  
  11. countrow = 0
  12. with open('mysheet.csv', newline='') as csvfile:
  13. thesheet = csv.reader(csvfile, delimiter=' ', quotechar='|')
  14.  
  15. thelength = sum(1 for row in thesheet) + 1
  16. dudes = 9
  17. matrix = [[0 for x in range(dudes)] for y in range(thelength)]
  18.  
  19. for row in thesheet:
  20. for mystring in row:
  21. shred = mystring.split(",")
  22. for x in range(0,8):
  23. matrix[countrow][x] = shred[x]
  24. countrow = countrow + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement