Found 4 num characters data from txt

Hello people! I hope you can help me with my problem, I want to type numers with a keypad and see if there's a match in a passwords list in a txt saved in a SD card, my problem now is that I dont know how to read 4 consecutive numbers from the txt, I search but I only found the way to detect a change line but how can I read and store in a variable every 4 consecutive numers?
this is the code what I have for see change lines

File myFile = SD.open("pass.txt",FILE_READ);
if (myFile)
{
while (myFile.available())
{

if( myFile.peek() == '\n' )
{
Serial.println(" Found line break");
delay(1000);
}
Serial.write( myFile.read() );
}
}

this is the content of my txt

#ID PASSWORD
1 0414
2 9456
3 3028
4 3291
5 0583

my problem now is that I dont know how to read 4 consecutive numbers from the txt

Read them one at a time.

   if(myFile.available() > 3) // As if you'd be reading someone else's file
   {
      char one = myFile.read();
      char two = myFile.read();
      char three = myFile.read();
      char four = myFile.read();

      // Do something with the 4 characters...
   }

Of course, an array could prove useful...

Thanks for your help PaulS, I’m working with your code because it recognize all characters, this is what I have for now hehe

while (myFile.available())
{

if(myFile.available()<=1)
{
int i = 0;
for (i==0; i==9; i++);
{
if (i == myFile.read())
{
numeracion[pass] = myFile.read();
if (numeracion[pass] == 4)
{
Serial.println(“password encontrado es:”) ;
for (int prin=0; prin=3; prin++)
{
Serial.println(numeracion[pass]);
}
}
}
}
}
}

it doesn’t work, im on it

          if(myFile.available()<=1)
          {

Reading stuff from the file only if there is one character or less in to be read doesn’t make a lot of sense.

            int i = 0;
            for (i==0; i==9; i++);
            {

The first clause is an assignment operation, NOT a comparison operation.
The second clause is a while condition. Starting with i equal to 0, while i equals 9, is not going to iterate many times.

  if (i == myFile.read())
              {
                numeracion[pass] = myFile.read();

Testing one character read from the file, and using the next one unconditionally does not make sense.

At least, could you help me reading character by character? or where can I find information about it? I'll thank you so much because I dont find information about it.

At least, could you help me reading character by character?

Sure. I did that in reply #1. I don’t understand how you translated that straightforward code into the mess you made.

If you know that the cursor in the file is at the start of the 4 characters you want to read:

   int number = -1;
   if(myFile.available() >= 4)
   {
      for(byte i=0; i<4; i++)
      {
         numeracion[i] = myFile.read();
      }
      numeracion[4] = '\0';
      number = atoi(numeracion);
   }
   Serial.print("number = ");
   Serial.println(number);