def __set_state_county(self): state_county_file = io.read_delimited(os.path.join(DIRS["data"],"acs_state_county_codes.csv")) state_county = {} for line in state_county_file[1:]: if line[2] in state_county.keys(): state_county[line[2]][line[4]] = line[5] else: state_county[line[2]] = {} return state_county
import os import sys utils = os.path.abspath(os.path.join('..')) sys.path.insert(0, utils) import utils.fileio as io contents = io.read_delimited(os.path.join('..',"data", "DSBS_NCCombined.csv")) #read each file from line 1 on for line in contents[1:]: #split last index of each line in the file line_split = line[-1].split() print line_split