CSVReader splits on tabs, not commas, and replace NaN with 0x0 in csv file swhen reporting to influx

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
Matthew Stidham
2021-07-14 16:05:56 -07:00
parent d6ef5bee74
commit ae2e95723c
3 changed files with 10 additions and 5 deletions

View File

@@ -69,7 +69,10 @@ class CSVtoInflux():
tags = dict()
print("row: %s" % row)
short_description = row[columns['short-description']]
numeric_score = float(row[columns['numeric-score']])
if row[columns['numeric-score']] == 'NaN':
numeric_score = '0x0'
else:
numeric_score = float(row[columns['numeric-score']])
date = row[columns['Date']]
date = datetime.datetime.utcfromtimestamp(int(date) / 1000).isoformat() #convert to datetime so influx can read it, this is required
for variable in csv_variables: