Module:Population
Apparence
La documentation de ce module est générée par le modèle {{Documentation module}}.
Les éditeurs peuvent travailler dans le bac à sable (modifier).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.
local p = {}
function p.test(frame)
local filename = "Population FR 01001 L'Abergement-Clémenciat.tab"
local content = mw.ext.data.get(filename)
-- check data structure
local fields = content.schema.fields
local datefield, popfield, methodfield, criterionfield, sourcefield, sourceurlfield
local popfield = 0
for num, j in ipairs(fields) do
if string.find(fields[num].name, "P585") then
datefield = num
elseif string.find(fields[num].name, "P1082") then
popfield = num
elseif string.find(fields[num].name, "P1082") then
popfield = num
elseif string.find(fields[num].name, "Q1013") then
methodfield = num
elseif string.find(fields[num].name, "Q459") then
criterionfield = num
elseif string.find(fields[num].name, "S248") then
sourcefield = num
elseif string.find(fields[num].name, "S248") then
sourceurlfield = num
end
end
-- exits if no field for population or date
if (popfield * datefield == 0) then
return "data could not be parsed correctly"
end
return popfield
-- return content.data[1][1]
end
return p