Fileseek and lines

I´m a student and have most experience of programming in C. When i use others languages (Python, Lua…) I´m very lost with some aspects. My problem is that I want to read a file and select some lines using their numbers value.

In C, I use arrays, so every line has the same length. So I can use “fileseek” with some maths.

For example:
1- The quick brown fox jumped over the lazy dog’s back
2 - Lorem Ipsum

They have the same length, with “\0” as nill value for to mark the end of the sentence. So I use fileseek with the length for reference:

The quick brown fox jumped over the lazy dog’s back\0\0\0\0
Lorem Ipsum\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0

My question is how can I take the lines by their number in Lua? Is there a function to do this? Or I’ll have to make a loop just to reach the line using a “x” value?

Thanks [import]uid: 54349 topic_id: 21796 reply_id: 321796[/import]