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

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -