Reputation: 39
I'm working with python, and also i'm working on a csv parse script, but i cannot write as CSV the new file with quotes as the input file, i access to the file in this way:
def read_file(self):
with open(self.file) as f:
parse_data=[row for row in csv.reader(f, delimiter=',',quotechar=('\"'), skipinitialspace=True)]
parse_data=self.organize_file(parse_data)
return parse_data
and when i try to write a new CSV file to store the new file i execute this:
with open("output.txt","wb") as m:
writer=csv.writer(m,delimiter=',',quotechar=('\n"'))
writer.writerows(meh)
with meh as the variable who has the lists to write on the CSV file, but when i open the output.txt file i cannot see the quotes on the fields, like the original
can somebody help me to realize what's wrong with my code, or pleas help me to modify the output to have all the quotes
Thanks!!
Upvotes: 0
Views: 85