motherapp / weight-csv-to-gfit

Load weights.csv and import to a Google Fit account
26 stars 20 forks source link

IndexError: list index out of range #3

Open Flint4 opened 6 years ago

Flint4 commented 6 years ago

Hi, thank you for the code. Appreciated! I think this is the only way to import Libra CSV at the moment. However, I am trying to import a sample CSV to get the code working. Everything works out until this error appears:

Reading Weights Traceback (most recent call last): File "import_weight_to_gfit.py", line 118, in import_weight_to_gfit() File "import_weight_to_gfit.py", line 95, in import_weight_to_gfit min_log_ns = weights[0]["startTimeNanos"] IndexError: list index out of range

I believe this is due to the CSV format? I am trying to import following CSV content:

2018-08-20 08:48:00;82.9;81.7294;;;

Initially I removed all lines with # symbols (headers) from the file. Timezone is set to "Europe/Zurich" in read_weight_csv.py

How can I fix this issue? Any ideas?

Best wishes, Alex

chwong1 commented 6 years ago

the delimiter is ',' rather than ';', see https://github.com/motherapp/weight-csv-to-gfit/blob/master/read_weight_csv.py