Template:MassBank/Matrix

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
m
m
Line 143: Line 143:
 
   ret = ""
 
   ret = ""
 
   comment = "";
 
   comment = "";
 +
  local head, tail;
 
   for line in stdin:gmatch("[%S ,]+") do
 
   for line in stdin:gmatch("[%S ,]+") do
 
     repeat
 
     repeat
 
     if (string.find(line, "^&&[&%a%d]+&&$") ~= nil) then break end
 
     if (string.find(line, "^&&[&%a%d]+&&$") ~= nil) then break end
     h, t = string.match(line, "^(["..FORMULA_CHAR.."]+) *: *(["..FORMULA_CHAR.." ]+)$");
+
     local h, t = string.match(line, "^(["..FORMULA_CHAR.."]+) *: *(["..FORMULA_CHAR.." ]+)$");
 
     if (h ~= nil and t ~= nil) then
 
     if (h ~= nil and t ~= nil) then
 
       if (comment ~= "") then
 
       if (comment ~= "") then
         ret = ret .. "#-\n"
+
         ret = ret .. "~-\n"
         ret = ret .. "##"..head.." ## "..tail.."\n"
+
         ret = ret .. "~~"..head.." ~~ "..tail.."\n"
         ret = ret .. "## "..comment.."\n"
+
         ret = ret .. "~~ "..comment.."\n"
 
         comment = ""
 
         comment = ""
 
       end
 
       end
Line 162: Line 163:
 
   end
 
   end
 
   if (comment ~= "") then  
 
   if (comment ~= "") then  
     ret = ret .. "#-\n"
+
     ret = ret .. "~-\n"
     ret = ret .. "##"..head.." ## "..tail.."\n"
+
     ret = ret .. "~~"..head.." ~~ "..tail.."\n"
     ret = ret .. "## "..comment.."\n"
+
     ret = ret .. "~~ "..comment.."\n"
 
   end
 
   end
 
   if (ret ~= "") then
 
   if (ret ~= "") then
     ret = '{# class="wikitable sortable"'.. ret ..'#}'
+
     ret = '{~ class="wikitable sortable"\n!Parent~~Fragment~~Comment\n'.. ret ..'~}'
 
     print(ret)
 
     print(ret)
 
   end
 
   end
 
|{{{data|CHClNOPS}}}
 
|{{{data|CHClNOPS}}}
 
}}
 
}}
|#|{{#bar:}}}}
+
|~|{{#bar:}}}}

Revision as of 01:44, 14 May 2009

No 'ION INFO' line in the form &&(formula)&&(formula)&&...&&

MassBank/Matrix 64
CHClONSP
64
CHClONSP



./lua: /tmp/mw_ex_lua_hrbCPW:26: attempt to concatenate local 'tail' (a nil value)

Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox