Template:FL digit78
From Metabolomics.JP
(Difference between revisions)
Line 1: | Line 1: | ||
− | {{#repeat: SearchMainLink|2| | + | <!--{{#repeat: SearchMainLink|2| |
{{#lua: | {{#lua: | ||
local L = {} | local L = {} | ||
Line 9: | Line 9: | ||
table.sort(L) | table.sort(L) | ||
table.foreach(L, function(x) print( L[x] .. " " .. x .. " ") end) | table.foreach(L, function(x) print( L[x] .. " " .. x .. " ") end) | ||
+ | | {{#SearchTitle:^{{{1}}}|}} }}| }} | ||
+ | --> | ||
+ | {{#repeat: SearchMainLink|2| | ||
+ | {{#lua: | ||
+ | local L = {} | ||
+ | local C = {} | ||
+ | local h, j | ||
+ | local i = 0 | ||
+ | for word in stdin:gmatch("%S+") | ||
+ | do h = string.sub(word,1,8) s = string.sub(word,7,8) | ||
+ | if (C[s] == nil) then | ||
+ | C[s]=s | ||
+ | i=i+1 | ||
+ | L[i]=s .. h | ||
+ | end | ||
+ | end | ||
+ | table.sort(L) | ||
+ | for j=1,i do | ||
+ | print( string.sub(L[j],3,10) .. " " .. string.sub(L[j],1,2) .. " ") | ||
+ | end | ||
| {{#SearchTitle:^{{{1}}}|}} }}| }} | | {{#SearchTitle:^{{{1}}}|}} }}| }} |
Revision as of 15:20, 25 March 2008