Sandbox

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
Line 3: Line 3:
 
<!---{{Index/name|F|G|FL|}}---->
 
<!---{{Index/name|F|G|FL|}}---->
  
{{#SearchLine:Common Name=|FL|}}
+
{{#lua:
 +
  local common = {"methoxy", "hydroxy", "acid"};
 +
  local key = stdin:match("%w+");
 +
  local H = {};
 +
  for id, name in stdin:gmatch("&&(%w+).Common Name=&&(%S+)") do
 +
    name = string.lower(name);
 +
    for term in string.gmatch(name,"(%a+)") do
 +
      if ((string.len(term) > 3) and
 +
          (string.sub(term,0,1) == key)) then
 +
        if (H[term] == nil) then
 +
          H[term] = id;
 +
        else
 +
          H[term] = H[term] .. ";" .. id;
 +
        end
 +
      end
 +
    end
 +
  end
 +
  table.sort(H);
 +
  for k,v in pairs(H) do
 +
    print(k.."&&"..v.."\n");
 +
  end
 +
|
 +
{{{1|a}}} {{#SearchLine:Common Name=||FL%}}
 +
}}

Revision as of 19:23, 1 October 2008

this is sandbox page.


Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox