Created
March 15, 2013 19:02
-
-
Save willkurt/5172225 to your computer and use it in GitHub Desktop.
processing location tree
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
import csv | |
with open("locations.csv","w") as csvfile: | |
cw = csv.writer(csvfile) | |
cw.writerow(["country","city","region1","location1","location2","location3"]) | |
with open("Location_Tree.csv","r") as infile: | |
for l in infile: | |
cw.writerow(map(lambda x: x.strip().replace('"',''),l.split('~'))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment