Skip to content

Instantly share code, notes, and snippets.

@hideshi
Created December 28, 2013 02:33
Show Gist options
  • Save hideshi/8155428 to your computer and use it in GitHub Desktop.
Save hideshi/8155428 to your computer and use it in GitHub Desktop.
Parse CSV file.
with open("file.csv", "r") as f:
for line in f.readlines():
for col in line.strip().split(","):
print(col.split(":"))
1:aa 2:bb 3:cc
4:dd 5:ee 6:ff
7:gg 8:hh 9:ii
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment