Hi there,
I try to write data from csv file to influx database. But I don’t know what is the correct way for this.
A short excerpt from the csv:
“2019-03-04 00:00:42”,“0”,“3”,“22.0149305555556”
“2019-03-05 00:00:44”,“0”,“3”,“21.7718750000001”
“2019-03-06 00:00:44”,“0”,“3”,“21.896875”
“2019-03-07 00:00:44”,“0”,“3”,“21.9378472222222”
“2019-03-08 00:00:44”,“0”,“3”,“21.7170138888889”
“2019-03-09 00:00:44”,“0”,“3”,“21.7329861111111”
“2019-03-10 00:00:44”,“0”,“3”,“21.8440972222222”
“2019-03-11 00:00:42”,“0”,“3”,“22.6135416666667”
First column contains a timestamp, second contains an unimportant flag, third column contains the table ID from export and the last column contains the measured temperature.
How can I import this file to InfluxDB for using here?
OK. I’ve now come a step further. I changed the csv file like this:
#datatype dateTime:2020-01-01 00:00:00,measurement,tag,double
time,measurement,location,temp
2020-12-25 10:30:42,Temperatur,Stube,20.9
2020-12-25 10:35:43,Temperatur,Stube,21.1
2020-12-25 10:40:43,Temperatur,Stube,21.1
2020-12-25 10:45:44,Temperatur,Stube,21.1
2020-12-25 10:50:42,Temperatur,Stube,21.1
If I run now:
influx write dryrun -o InfluxData -b edomi -f /tmp/archiv3.csv
I get this error for each line:
Unable to batcher to error-file: invalid argument
line 120207: column ‘time’: parsing time “2022-03-02 15:00:50” as “2020-01-01 00:00:00”: cannot parse “-03-02 15:00:50” as “0-”
Something is wrong with my “dateTime:2020-01-01 00:00:00” but I don’t know how it has to be…
I guess the format string must be in golang time parser format, so it should look like this:
dateTime:2006-01-02 15:04:05
Hi @Franky1 , your my hero.
It works now