MY C++ APPLICATION is reading data form device.e.g Temperature sensor. Sensor is transmitting update after 1 seconds. But I want to insert the sensor update data only when temperature changed with current timestump into CSV file using java script.For the first time i need to create a new file and afterwords just update the previous file.
Required CSV file
Time Temp(C)
12:30:12:325 57
12:30:15:351 56
12:30:17:453 57
What I have tried:
HTML+JS.
----------
<html>
<script type="text/javascript">
function createCSV() {
csvRows = [["label first","details of label 1"],["label sec","details of label 2"],["label 3","details of label 3"],["label 4","details of label 4 and 3"],["label 5","details of label 5"],["label 6","details of label 6"],["label 7","details of label 7"],["label 8","details of label 8"],["label 9","details of label 9"]];
var csvString = csvRows.join("%0A");
var a = document.createElement('a');
a.href = 'data:attachment/csv,' + csvString;
a.target = '_blank';
a.download = 'myFile.csv';
document.body.appendChild(a);
a.click();
}
</script>
<body>
<form action="" method="post">
<input type="button" value="Create" >
</form>
</body>
</html>