I’m trying to analyze a wiktionary dump in sql using python sqlite3. I’m just trying to output all the words that fall into certain categories, so once I get that list, I’m done with the sql file. I don’t have any experience with sqlite3 but have 10K hours of experience with Python. I’m guessing I need to convert that sql file into a db file. That’s step 1. I’ll post step 2 as another thread. So my question is, how do I convert the sql file into a db file. I see on the sqlite3 documentation that you can convert db into sql, but I can’t find the other way around.
con = sqlite3.connect('existing_db.db')
with open('dump.sql', 'w') as f:
for line in con.iterdump():
f.write('%sn' % line)
con.close()