Created
March 19, 2015 20:07
-
-
Save aepyornis/43376cb20d18f939a990 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# get bbls | |
import glob | |
import csv | |
def get_bbl(row): | |
return row[69] + ',' | |
# create file to store bbls | |
bbl_file = open('./all_bbls.csv', 'w') | |
# get all pluto csvs - change filepath as needed | |
list_of_files = glob.glob('./data/pluto/*.csv') | |
# iterate through files | |
for path in list_of_files: | |
with open(path) as f: | |
# ignore first line | |
next(f) | |
# handle file as CSV | |
reader = csv.reader(f, delimiter=',', quotechar='"') | |
# write bbl for each row | |
for row in reader: | |
bbl_file.write(get_bbl(row)) | |
# close bbl_file | |
bbl_file.close() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment