Page 1 of 1

read a line in a text file without loading entire file

Posted: Tue Aug 04, 2020 6:14 am
by mchael
Is there a way with purebasic to read a specific line of a file without reading the whole file? Seek and read the part of the file with a specific line?

Re: read a line in a text file without loading entire file

Posted: Tue Aug 04, 2020 6:50 am
by infratec
Of course. But it is slower.
Simply use ReadString() for n times.

Fast it is only possible if all lines have the same length.
Then you can use FileSeek() to jump the right location.

Re: read a line in a text file without loading entire file

Posted: Mon Aug 10, 2020 3:47 am
by mchael
thank you

yes each line is same memory size so fileseek is useful.