Module:Demographics/Areas

local regions = mw.loadData( 'Module:LoadJsonTest/Regions' ) local areas_json = mw.title.new( 'Demographics/Areas.json', 'Module' ) local areas_data = mw.text.jsonDecode( areas_json:getContent ) local p = {}

for i, row in ipairs(areas_data['areas']) do	row['region'] = regions[row['regionID']] row['regionID'] = nil table.insert(p, row) end

return p -- Don't forget to use this - http://www.convertcsv.com/csv-to-json.htm - to convert your tables to JSON, mkay?