title: Print table in Lua
body: <p>I have a script in Lua and I need to print the variable res, but I do not know how to do this print. I get the result of the function in another function, where I wanted to do print</p>
  
  <pre><code>function parseCSVLine(line) 
    local res = {}
    local pos = 1
    local sep = ','
    while true do 
       local c = string.sub(line,pos,pos)
       if (c == "") then break end
       if (c == '"') then
          -- quoted value (ignore separator within)
          local txt = ""
          repeat
             local startp,endp = string.find(line,'^%b""',pos) -- Digitos
             txt = txt..string.sub(line,startp+1,endp-1)
             pos = endp + 1
             c = string.sub(line,pos,pos) 
             if (c == '"') then txt = txt..'"' end 
             -- check first char AFTER quoted string, if it is another
             -- quoted string without separator, then append it
             -- this is the way to "escape" the quote char in a quote. example:
             --   value1,"blub""blip""boing",value3  will result in blub"blip"boing  for the middle
          until (c ~= '"')
          table.insert(res,txt)
  --        assert(c == sep or c == "")
          pos = pos + 1
       else
          -- no quotes used, just look for the first separator
          local startp,endp = string.find(line,sep,pos)
          if (startp) then 
             table.insert(res,string.sub(line,pos,startp-1))
             pos = endp + 1
          else
             -- no separator found -&gt; use rest of string and terminate
             table.insert(res,string.sub(line,pos))
             break
          end 
       end
    end
    return res
  end
  </code></pre>
  
  <p>example</p>
  
  <pre><code>local result = parseCSVLine(line) 
  </code></pre>
  
  <p>Here I wanted to print the result</p>