Search inside a SD txt file

Dear Fellowes The While(myFile.available()) loop reads in sequence order. So, lets say that I have 9 records in myFile and search for#7, on 6 records before I get "Wrong number" and when search arrives to #7 I get finally "OK number" but continues sending "Wrong number" until #9.

Is there some function like end of file() to use and avoid this issue?

I´m stuck here, have you please any ideas to help me?

Thanks in advance. Jose

Post your code please.

Don’t forget to use the Code button </>

When you have found your record in the while loop, you can break. See e.g.https://www.arduino.cc/en/Reference/Break

Is there some function like end of file() to use and avoid this issue?

The .available() method tells you how many bytes there still are to read, based on the size of the file and the cursor position (how much you have already read).