Volatile:ListMolByReference: Difference between revisions

mNo edit summary
mNo edit summary
Line 19: Line 19:
       print(i)
       print(i)
       for j,x in ipairs(w) do
       for j,x in ipairs(w) do
         au, ja, yr = string.match(x, "([%w]+)[^,]+,([^,]+),([%d]+)" )
         au, ja, yr = string.match(x, "([%w ]+):[^,]+,([^,]+),([%d]+)" )
         print('([[Reference:' ..x.. '&' ..au..'_'..yr..'_'..ja.. ']])')
         print('([[Reference:' ..x.. '&' ..au..'_'..yr..'_'..ja.. ']])')
       end
       end

Revision as of 14:10, 27 June 2013

Searching IDs with {{{1}}} in the reference namespace.


{{#lua:

 idS = {}
 count=0
 for ref, sp, id in stdin:gmatch("|?|?([^|]+)||([%w\., ]+)||([^\n]+)") do
   local S = idS[id]
   if (S == nil) then idS[id]={} S = idS[id] count = count + 1 end
   if (S[sp] == nil) then S[sp] = {ref}
   else table.insert(S[sp], ref) end
 end
 print("Showing below ".. count .. " structures.")
 for k,v in pairs(idS) do
   print("* " ..k.. " File:" ..k.. ".png ")
   for i,w in pairs(v) do
     print(i)
     for j,x in ipairs(w) do
       au, ja, yr = string.match(x, "([%w ]+):[^,]+,([^,]+),([%d]+)" )
       print('(' ..au..'_'..yr..'_'..ja.. ')')
     end
   end
 end

| {{{1}}} }}