Ok, I used example from wiki and explode (founded in Google), works good. Thanks. If somebody would need it, here:
f = fileOpen("thefile.txt", false)
local FullText = fileRead(f, 100)
while not fileIsEOF(f)
do
FullText = FullText .. fileRead(f, 100)
end
fileClose(f)
Lines = explode("\n", FullText)
for i = 1, #Lines
do
-- line: Lines[i]
end
Explode function:
function explode (seperator, str) --from: [url=http://luanet.net/lua/function/explode]http://luanet.net/lua/function/explode[/url]
local pos, arr = 0, {}
for st, sp in function() return string.find( str, seperator, pos, true ) end do -- for each divider found
table.insert( arr, string.sub( str, pos, st-1 ) ) -- Attach chars left of current divider
pos = sp + 1 -- Jump past current divider
end
table.insert( arr, string.sub( str, pos ) ) -- Attach chars right of last divider
return arr
end