LUA: String to variables
snippet in lua

LUA: String to variables

user1792

data = "12-05-17 12:48:48 12.3 23 -8.2 1 2 225 0.0 0.0 992.3 SW 1 m/s C hPa mm 49.8 +0.1 0.6 60.0 0.0 21.5 31 12.3 +0.7 13.0 11:31 1.2 01:31 4 10:40 7 09:36 992.4 12:28 989.4 00:00 1.9.4 1099 6 12.3 12.3 0 0.00 0 176 0.0 24 1 0 S 2560 m 8.7 0.0 750 0 "

value = { }
n = 0

for v in data:gmatch("%S+") do
    n = n + 1
    value[n]=v
end

Date = value[1]
Time = value[2]
Temp = value[3]
Humidity = value[4]
WindSpeed = value[13]
HighTemp = value[27]
CloudBase = value[53]

print(Date,Time,Temp,Humidity,WindSpeed,HighTemp,CloudBase)