date - I need to remove the ' from every row of a csv -
i have bunch of csv files have data in format of yyyy-mm-dd hh,value can split hours off running
 open(out_path+filename,'r+') data_r:                     comreader = csv.reader(data_r, delimiter=' ', quotechar='"')             row in comreader:                 print ','.join(row) from
'yyyy-mm-dd,hh',value what need remove (') in front of yyyy , after hh
you're using quotechar parameter, wrongly: 
it should read "'" if want interpret ' character surrounding strings.
other that, can parts of strings python's slicing abilities:
outstring = instring[1:-1] will give 1. (dropping 0.) (excluding it) last character.
Comments
Post a Comment