For 5 years, I use a weather station La Crosse WS2350. The data provided by the weather station are processed with open2300 on RPI. This works very well. However, the temperature data is false (sensor). The temperature data is 1 ° C lower.
Since I can not calibrate the sensor, I want to change the temperature value from the file extracted from the weather station.
This text file (current.txt) contains:
Date 2016-Dec-03
Time 10:30:29
Ti 11.9
Timin 11.6
Timax 27.7
TTin 10:34
DTimin 2016-01-19
TTimax 00:44
DTimax 2016-08-28
To -2.4
Tomin -4.8
Tomax 37.4
TTomin 06:46
DTomin 2016-02-18
TTomax 16:13
DTomax 2016-07-19
...
I want to add +1 to the values "To", "Tomin", "Tomax" and overwrite the text file with the correct values.
After looking at the sed and awk commands, I realize that I'm outdated. Can anyone guide me? Thanks
Edit :
I forgot another file: ws2308.log Every 15 minutes a new line is added to the file ws2308.log :
...
20161203150600 2016-Dec-03 15:06:00 11.8 -1.1 -3.2 65 87 0.0 157.5 SSE -1.1 569.80 1015.700
20161203152100 2016-Dec-03 15:21:00 12.3 -1.1 -3.2 64 87 0.0 157.5 SSE -1.1 569.80 1015.600
20161203153600 2016-Dec-03 15:36:00 12.2 -1.2 -3.3 64 87 0.0 135.0 SE -1.2 569.80 1015.700
The value to be modified is the 5th field (the first -1.2)
It is also necessary that on the last line, the value of the temperature is incremented by 1 and overwrite the last line with the correct value. Only the last line will be taken into account by the program php which allows to display the results in a graph.
Thanks