I have a file that I want to read only a few lines, not all lines. I get by GET the lines I want to read, which are numbers. I can only read the entire file.
local inicio = GET["inicio"]
local fim = GET["fim"]
local f = io.open(ficheiro, "r" ) --ler ficheiro
for line in f:lines() do --correr lignas
--insert table
table.insert(dat_array, line)
end
For example if the beginning is 2 and the end 6, read in the cycle is only those lines.