I have an interim solution. I copied the witem program that @MadeInGermany wrote which I am using to get all the data over to a new file. In that file I changed it to read the 5th line after "Wind" which is the value of "Wind Chill".
the weather-data.txt file is like this
Code:
Condition:
Clear
Pressure:
103.3 kPa
Tendency:
Rising
Temperature:
-3.9°C
Dew point:
-7.2°C
Humidity:
78%
Wind:
WNW 5 km/h
[36]Wind Chill:
-6
Visibility:
24 km
Clear
-4°C
Condition:
Clear
Pressure:
103.3 kPa
Tendency:
Rising
Temperature:
-3.9°C
Dew point:
-7.2°C
The new file I created is like this
Code:
#!/bin/bash
while read line
do
line=${line%$'\r'} # Remove a WinDOS CR
case $line in ( "$1:" )
read line2
read line3
read line4
read line5
line5=${line5%$'\r'}
echo "$line5"
break # Stop at first match
esac
done < weather-data.txt
I also added an if statement to change windchill = $temp if windchill is greater than zero because when there is no windchill it will pick up the visibility value I think.
I would like to thank everyone that helped me on this and were patient with an 73 year old fart.