2021-12-22 17:15:19 +01:00
|
|
|
|
|
|
|
package.path = package.path .. ";luajson/?.lua"
|
|
|
|
local JSON = require"json"
|
|
|
|
|
2021-12-22 17:25:01 +01:00
|
|
|
local path_in = "../tables/whathappensnext.json"
|
2021-12-22 17:15:19 +01:00
|
|
|
local f1 = io.open(path_in, "r")
|
|
|
|
local strjson = f1:read("*a")
|
|
|
|
f1:close()
|
|
|
|
local tabData = JSON.decode(strjson)
|
|
|
|
|
|
|
|
local results = {}
|
|
|
|
for idx, row in pairs(tabData.rows) do
|
|
|
|
local min = row.range[1]
|
|
|
|
local max = row.range[2]
|
|
|
|
local field = tostring(2).."-"..tostring(max)
|
|
|
|
--results[field] = "<b>"..row.name.."</b>:"..row.description
|
|
|
|
results[field] = row.description
|
|
|
|
print(field, row.name)
|
|
|
|
end
|
|
|
|
|
|
|
|
local entries = JSON.encode(results)
|
|
|
|
print()
|
|
|
|
print()
|
|
|
|
print(entries)
|