I'm trying to read txt file (has numeric values) line by line. I used SPIFFS and I used this function
void readFile(fs::FS &fs, const char * path){
Serial.printf("Reading file: %s\r\n", path);
File file = fs.open(path);
if(!file || file.isDirectory()){
Serial.println("− failed to open file for reading");
return;
}
int count = 0;
Serial.println(" read from file:");
while(file.available()){
if (count < 100)
Serial.write(file.read());
}
}
What is the alternative function for "file.read()" something like "readline" because I need to read the file from first line to 100 and from 101 to 200 and so on .