[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Extracting list of items from line?
- From: Shmuel Zeigerman <shmuz@...>
- Date: Mon, 18 Apr 2011 12:45:31 +0300
On 18/04/2011 12:19, Gilles Ganault wrote:
Also, I'm confused about when to use : and ., eg. should I use
execs:read() or execs.read()?
execs is an object (i.e. userdata), thus execs:read()
Try the following:
for line in io.lines("execs.txt") do
local libs = line:match(" (.*)")
if not libs then error("Space not found in " .. line) end
for lib in libs:gmatch("[^,]+") do print(lib) end
print("----")
end
--
Shmuel