I have a table in sqlite
CREATE TABLE nutritional_values
(item,
calories,
total_fat_g,
saturated_fat_g,
polyunsaturated_g,
monosaturated_g,)''')
I create my TABLE using SQLite in a python, by running from the command line the file
c:\users\John\diet\nutrition.py
then i have hundreds of individual files saved in
c:\users\John\diet\food_items
which look like
# item
'avocado',
# calories
160,
# total_fat_g
14.7,
# saturated_fat_g
2.1,
# polyunsaturated_g
1.8,
# monosaturated_g
9.8,
I could save these as txt files, or anything else suitable. The hash mark line is just a comment to help me when i create these files.
How can I read in all these files into my SQLite nutritional_values table?
So each file creates one line in the table.