Inspired by the accepted answer to Reading a UTF8 CSV file with Python, I've tried the following but get
ValueError: need more than 5 values to unpack
Seems the empty strings are tripping me here. Is there a function I should apply to row
to make this work? I'll need to work with these variables individually further down the line. Thanks.
def encodevar(x):
return x
row = ['85123', '', '123 The Address', '', '', 'TUCSON', 'AZ ', 'The Company Name', '', '']
for zip5,zip4,strname,strnumber,strsuite,city,state,busname,lname,fname in row:
HHid = encodevar( zip5 ) +\
encodevar( zip4 ) +\
encodevar( stname ) +\
encodevar( stnumber ) +\
encodevar( stsuite ) +\
encodevar( busname )