Template:CountryTable
From Metabolomics.JP
(Difference between revisions)
| (64 intermediate revisions by one user not shown) | |||
| Line 1: | Line 1: | ||
| − | {| | + | {{#def:namespace|Reference}} |
| + | [[Reference:Country|«UP one level]] | ||
| + | <small>To add/edit your information, click the edit tab above, and edit "&&"-separated information. (Remember to use "&&"!)</small> | ||
| + | <table> | ||
| + | <th colspan=2>Top 5 institutes in this country (total {{#count:{{{1|}}}}} authors)</th> | ||
| + | <tr><td> | ||
| + | {{#repeat:List_Country/inst_rank|1| | ||
| + | {{#lua: | ||
| + | local auCount = {}; | ||
| + | for au, inst, cy in stdin:gmatch("&?&?([%w\. ]+)&&([%w\., ]+)&&([^\n]+)") do | ||
| + | if (inst ~= nil) then | ||
| + | if (auCount[inst] == nil) then | ||
| + | auCount[inst] = 1; | ||
| + | else | ||
| + | auCount[inst] = auCount[inst] + 1; | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | local hash = {}; | ||
| + | local list = {}; | ||
| + | local afCount = {}; | ||
| + | for inst, num in pairs(auCount) do | ||
| + | table.insert(list, num); | ||
| + | if (hash[num] == nil) then | ||
| + | hash[num] = inst; | ||
| + | afCount[num] = 1; | ||
| + | else | ||
| + | hash[num] = hash[num] .. "; " .. inst; | ||
| + | afCount[num] = afCount[num] + 1; | ||
| + | end | ||
| + | end | ||
| + | table.sort(list); | ||
| + | local i=0; | ||
| + | local output = ""; | ||
| + | local num, inst; | ||
| + | while(i < 5) do | ||
| + | num = table.remove(list); | ||
| + | if (num == nil) then break; end | ||
| + | inst = hash[num]; | ||
| + | i = i + afCount[num]; | ||
| + | output = output .. inst .. " (" .. num .." authors)&&"; | ||
| + | end | ||
| + | print(output); | ||
| + | |{{{1|}}} }} | ||
| + | |&&}} | ||
| + | </td> | ||
| + | |||
| + | </tr> | ||
| + | </table> | ||
| + | |||
| + | {| class="sortable" border="1" cellpadding="2" cellspacing="1" style="font-size: smaller; float: center; clear: none; margin: 1em 1em 1em 1em" | ||
|- | |- | ||
! Author | ! Author | ||
| Line 5: | Line 55: | ||
! Country | ! Country | ||
|- | |- | ||
| − | {{#repeatNum: TableRow3|3| | + | {{#repeatNum: TableRow3/Country|3| |
<!---START OF Author & Affiliation & Country ---> | <!---START OF Author & Affiliation & Country ---> | ||
| − | {{{1|}}} | + | {{#ifeq:{{#substring:{{{1|}}}|0|2}}|&&|{{#cdr:{{{1|}}}|&&}}|{{{1|}}}}} |
<!---END OF Author & Affiliation & Country ---> | <!---END OF Author & Affiliation & Country ---> | ||
|&&}} | |&&}} | ||
|} | |} | ||
Latest revision as of 01:39, 7 December 2010
«UP one level To add/edit your information, click the edit tab above, and edit "&&"-separated information. (Remember to use "&&"!)
| Top 5 institutes in this country (total 0 authors) |
|---|
| Author | Affiliation | Country |
|---|