0

I want to export the MS Access table I'm using into a csv/xlsx file. I have tried this:

def write_to_csv1(result): 

with open ('jur.csv', 'a', newline='') as f:
    w = csv.writer(f, dialect='excel')
    for record in result:
        w.writerow(record)

But this makes all the row to be placed in a same column. What I need it to do is separate the row into columns to be just like the Acess table.

Damnum
  • 1
  • How does a `record` look like (i.e. what `type` is it)? – Timus Nov 09 '20 at 11:56
  • Does this answer your question? [How to export MS Access table into a csv file in Python using e.g. pypyodbc](https://stackoverflow.com/questions/36112512/how-to-export-ms-access-table-into-a-csv-file-in-python-using-e-g-pypyodbc) – June7 Nov 09 '20 at 18:31
  • I managed to solve it with a pandas dataframe, much easier than CSV. Thank you. – Damnum Nov 10 '20 at 02:30
  • I’m voting to close this question because user doesn't need it answered. – wazz Nov 13 '20 at 18:31

0 Answers0