Created
December 28, 2013 02:33
-
-
Save hideshi/8155428 to your computer and use it in GitHub Desktop.
Parse CSV file.
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
with open("file.csv", "r") as f: | |
for line in f.readlines(): | |
for col in line.strip().split(","): | |
print(col.split(":")) | |
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
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