25 lines
638 B
Lua
25 lines
638 B
Lua
|
|
package.path = package.path .. ";luajson/?.lua"
|
|
local JSON = require"json"
|
|
|
|
local path_in = "../tables/doom2.json"
|
|
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
|
|
--if row.range.Hiver[1] then
|
|
local min = row.range[1]
|
|
local max = row.range[2]
|
|
local field = tostring(min).."-"..tostring(max)
|
|
--results[field] = "<b>"..row.name.."</b>:"..row.description
|
|
results[field] = row.description
|
|
print(field, row.name)
|
|
--end
|
|
end
|
|
local entries = JSON.encode(results)
|
|
print()
|
|
print()
|
|
print(entries) |