How to load text file into sort of table-like variable in Lua?
snippet in lua

How to load text file into sort of table-like variable in Lua?

user6494

function read_addresses(filename)
  local database = { }
  for l in io.lines(filename) do
    local n, a, e = l:match '(%S+)%s+(%S+)%s+(%S+)'
    table.insert(database, { name = n, address = a, email = e })
  end
  return database
end