Volatile:ListMolByReference: Difference between revisions

No edit summary
mNo edit summary
Line 7: Line 7:
{{#lua:
{{#lua:
   idS = {}
   idS = {}
   for ref, sp, id in stdin:gmatch("&?&?([%w\. ]+)&&([%w\., ]+)&&([^\n]+)") do
   for ref, sp, id in stdin:gmatch("&?&?([%w\., ]+)&&([%w\., ]+)&&([^\n]+)") do
     local S = idS[id]
     local S = idS[id]
     if (S == nil) then idS[id]={} S = idS[id] end
     if (S == nil) then idS[id]={} S = idS[id] end
     if (S[sp] == nil) then S[sp] = {ref} print(ref)
     if (S[sp] == nil) then S[sp] = {ref}
     else table.insert(S[sp], ref) end
     else table.insert(S[sp], ref) end
   end
   end

Revision as of 04:56, 10 March 2013

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

Showing below 1 results of search {{{1}}}.

{{#lua:

 idS = {}
 for ref, sp, id in stdin:gmatch("|?|?([%w\., ]+)||([%w\., ]+)||([^\n]+)") do
   local S = idS[id]
   if (S == nil) then idS[id]={} S = idS[id] end
   if (S[sp] == nil) then S[sp] = {ref}
   else table.insert(S[sp], ref) end
 end
 for k,v in pairs(idS) do
   print("* File:" ..k.. ".png ")
   for i,w in pairs(v) do
     print(i)
     for j,x in ipairs(w) do
       print("(ref)")
     end
   end
 end

| {{{1}}} }}