[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Read text file and iterate through items?
- From: Gilles Ganault <gilles.ganault@...>
- Date: Mon, 18 Apr 2011 19:11:26 +0200
On Mon, 18 Apr 2011 12:07:56 -0500, Rob Hoelz <rob@hoelz.ro> wrote:
>Also, you're using the for loop wrong. For iterating over each line in
>a string, you'd probably use string.gmatch; for a table, try ipairs or
>pairs.
Thanks but why is it better to use string.gmatch() instead of
io.lines()? In this case, there's only one item per line.