I wrote a perl script below that converts your csv to a json file. I made it 24 hours
1-8-2021 12:00:00 AM 19,527 GJ 23 m3/h 59,98 C 57,76 C 172,574 m3
1-8-2021 01:02:00 AM 19,528 GJ 25 m3/h 59,69 C 57,44 C 172,597 m3
1-8-2021 02:02:00 AM 19,528 GJ 26 m3/h 59,69 C 57,44 C 172,598 m3
1-8-2021 03:02:00 AM 19,529 GJ 26.1 m3/h 59,69 C 57,44 C 172,598 m3
1-8-2021 04:02:00 AM 19,529 GJ 26.8 m3/h 59,69 C 57,44 C 172,598 m3
1-8-2021 05:02:00 AM 19,530 GJ 27.7 m3/h 59,69 C 57,44 C 172,599 m3
1-8-2021 06:02:00 AM 19,531 GJ 27.9 m3/h 59,69 C 57,44 C 172,599 m3
1-8-2021 07:02:00 AM 19,531 GJ 28.6 m3/h 59,69 C 57,44 C 172,600 m3
1-8-2021 08:02:00 AM 19,532 GJ 29.4 m3/h 59,69 C 57,44 C 172,601 m3
1-8-2021 09:02:00 AM 19,532 GJ 29.9 m3/h 59,69 C 57,44 C 172,601 m3
1-8-2021 10:02:00 AM 19,533 GJ 30.3 m3/h 59,69 C 57,44 C 172,602 m3
1-8-2021 11:02:00 AM 19,534 GJ 30.3 m3/h 59,69 C 57,44 C 172,602 m3
1-8-2021 12:02:00 PM 19,534 GJ 30.9 m3/h 59,69 C 57,44 C 172,602 m3
1-8-2021 02:02:00 PM 19,535 GJ 31.1 m3/h 59,69 C 57,44 C 172,603 m3
1-8-2021 03:02:00 PM 19,536 GJ 32.2 m3/h 59,69 C 57,44 C 172,604 m3
1-8-2021 04:02:00 PM 19,536 GJ 32.8 m3/h 59,69 C 57,44 C 172,604 m3
1-8-2021 05:02:00 PM 19,537 GJ 32.8 m3/h 59,69 C 57,44 C 172,604 m3
1-8-2021 06:02:00 PM 19,538 GJ 33.2 m3/h 59,69 C 57,44 C 172,605 m3
1-8-2021 07:02:00 PM 19,538 GJ 33.5 m3/h 59,69 C 57,44 C 172,605 m3
1-8-2021 08:02:00 PM 19,539 GJ 34.4 m3/h 59,69 C 57,44 C 172,606 m3
1-8-2021 09:02:00 PM 19,539 GJ 34.4 m3/h 59,69 C 57,44 C 172,606 m3
1-8-2021 10:02:00 PM 19,540 GJ 34.5 m3/h 59,69 C 57,44 C 172,606 m3
1-8-2021 10:02:00 PM 19,540 GJ 35.5 m3/h 59,69 C 57,44 C 172,607 m3
1-8-2021 11:02:00 PM 19,540 GJ 36.5 m3/h 59,69 C 57,44 C 172,608 m3
the perl scrip is:
#!/usr/lib/perl -w
#Written By JLG
#Version 1.0
use strict;
use warnings;
;
#
#-------------------------------------------------------------------------------------------------------------------
#
# Open the output files
#
#-------------------------------------------------------------------------------------------------------------------
#
my $file = './Error.txt';
open(ERROR, ">$file") || die print "Can't open error check $file \n" ;
$file = './file.json'; # open the output file
open(OUT, ">$file") || die print "Can't open error check $file \n" ;
#
#-------------------------------------------------------------------------------------------------------------------
#
# Read the data from the csv file
#
#-------------------------------------------------------------------------------------------------------------------
#
$file = './file.txt'; # open the input file
open(INPUT, "<$file") || die print ERROR "Can't open $file \n" ;
my $line = '';
while ($line = <INPUT>) {
$line =~ s/^\s+|\s+$//g;
chomp $line;
my @WA = split(/ /, $line); # split on space
print OUT "{\"datetime\": $WA[0] $WA[1] $WA[2], \"energy\": $WA[3], \"rate1\": $WA[5], \"temperature1\": $WA[7], \"temperature2\": $WA[9], \"total_volume\": $WA[11]}\n";
}
close (INPUT);
close(OUT);
close(ERROR);
The output file is:
{"datetime": 1-8-2021 12:00:00 AM, "energy": 19,527, "rate1": 23, "temperature1": 59,98, "temperature2": 57,76, "total_volume": 172,574}
{"datetime": 1-8-2021 01:02:00 AM, "energy": 19,528, "rate1": 25, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,597}
{"datetime": 1-8-2021 02:02:00 AM, "energy": 19,528, "rate1": 26, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,598}
{"datetime": 1-8-2021 03:02:00 AM, "energy": 19,529, "rate1": 26.1, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,598}
{"datetime": 1-8-2021 04:02:00 AM, "energy": 19,529, "rate1": 26.8, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,598}
{"datetime": 1-8-2021 05:02:00 AM, "energy": 19,530, "rate1": 27.7, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,599}
{"datetime": 1-8-2021 06:02:00 AM, "energy": 19,531, "rate1": 27.9, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,599}
{"datetime": 1-8-2021 07:02:00 AM, "energy": 19,531, "rate1": 28.6, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,600}
{"datetime": 1-8-2021 08:02:00 AM, "energy": 19,532, "rate1": 29.4, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,601}
{"datetime": 1-8-2021 09:02:00 AM, "energy": 19,532, "rate1": 29.9, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,601}
{"datetime": 1-8-2021 10:02:00 AM, "energy": 19,533, "rate1": 30.3, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,602}
{"datetime": 1-8-2021 11:02:00 AM, "energy": 19,534, "rate1": 30.3, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,602}
{"datetime": 1-8-2021 12:02:00 PM, "energy": 19,534, "rate1": 30.9, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,602}
{"datetime": 1-8-2021 02:02:00 PM, "energy": 19,535, "rate1": 31.1, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,603}
{"datetime": 1-8-2021 03:02:00 PM, "energy": 19,536, "rate1": 32.2, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,604}
{"datetime": 1-8-2021 04:02:00 PM, "energy": 19,536, "rate1": 32.8, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,604}
{"datetime": 1-8-2021 05:02:00 PM, "energy": 19,537, "rate1": 32.8, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,604}
{"datetime": 1-8-2021 06:02:00 PM, "energy": 19,538, "rate1": 33.2, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,605}
{"datetime": 1-8-2021 07:02:00 PM, "energy": 19,538, "rate1": 33.5, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,605}
{"datetime": 1-8-2021 08:02:00 PM, "energy": 19,539, "rate1": 34.4, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,606}
{"datetime": 1-8-2021 09:02:00 PM, "energy": 19,539, "rate1": 34.4, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,606}
{"datetime": 1-8-2021 10:02:00 PM, "energy": 19,540, "rate1": 34.5, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,606}
{"datetime": 1-8-2021 10:02:00 PM, "energy": 19,540, "rate1": 35.5, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,607}
{"datetime": 1-8-2021 11:02:00 PM, "energy": 19,540, "rate1": 36.5, "temperature1": 59,69, "temperature2": 57,44, "total_volume": 172,608}
I can’t upload the files but you should be able to copy and paste.
Hope this is of value