seeking out the tag on .txt into SD card - RFID

Hi, guys

I am trying to make an RFID with the list of tags inside the SD card, so that the program looks for the authorized tag inside the .txt

with this code below, I was able to read the tags, however it reads all at once. Is there any way to make the sketch look for the tag within .txt more effectively?

myFile ="ANV.txt");
    if (myFile) {
      while (myFile.available() && (c2 == 0)) {
        caractere = 0;
        while (myFile.available() && (caractere != ';') && (caractere != 13) && (c1 == 0)) {
          caractere =;
          if ((caractere != ';') && (caractere != 13)) {


taking into account that the tags are stored as follows in .txt



Why do you have two while(myFile.available() statements, one nested inside the other in your snippet?

Why did you waste our time by posting only a snippet?

You can speed up reading text files by using fixed length records. Then, you can read a record in one step, instead of looking at each character, to see if it is the end of record marker.

You can store the data read from the file in a string (a NULL terminated array of chars) far faster than you can store it in a String, with all the dynamic memory allocation and copying that happens when you add one character at a time to the String instance.

EVERYTHING that you can do with a String can be done using a string, with less code and less memory.