Sometimes it's better to use python.
That's all.
import splite3
path = 'path_to_db'
conn = sqlite3.connect(path)
import pandas as pd
header = []
c = conn.cursor()
for column in c.execute('PRAGMA table_info("table_name")'):
header.append(column[1])
df = pandas.DataFrame(columns=header)
for raw in c.execute('SELECT * FROM table_name ORDER BY index_name):
series = pd.Series(list(raw), index=df.columns)
df = df.append(s, ignore_index=True)
df.to_csv('path_to_csv')
It is a miso that the data is reassigned to df
every time it append`s.
Recommended Posts