Taking data from SD card row to serial.

Hello! I'm new to arduino and i need help for my project.
I want to take data from pin to serial. So, if i store data to Array, for example i have char '2' in my array that mean i want to get second row from my .txt data

#include <SD.h>
    #include <SPI.h>
    
    File myFile;
    int pinCS = 53;
    String line;
    void setup() {
        
      Serial.begin(9600);
      pinMode(pinCS, OUTPUT);
      
      if (SD.begin())
      {
        Serial.println("SD card is ready to use.");
      } else
      {
        Serial.println("SD card initialization failed");
        return;
      }
     myFile = SD.open("CEK.txt");
      if (myFile) {
        Serial.println("Read:");
        
          while (myFile.available()) {
          line = myFile.readStringUntil('\0');
          }
          Serial.print(line);
          Serial.print(line[2]);

        myFile.close();
      }else {
        Serial.println("error opening file");
      }
    
    }

But this only shows every data stored in my .txt files.
Really appreciate any kind of help, thank you!

Really appreciate any kind of help, thank you!

Why don't you help us help you. Post the contents of the file on the SD card.

Get rid of the commented out code. Put every { on a line BY ITSELF. Put every } on a line BY ITSELF. Use Tools + Auto format.

Somewhere you need to count the records read from the file, and only print the correct one.

The content looks like this:

  1. abcBook1 = 13.
  2. ascaBook2 = 2.
  3. ascBook3 = 5.
  4. asaBook4 = 7.

And so on..

Where is the information about what row you want? I don't see any arrays in the mess of code you posted.

What does that mean?

So if i read data and and translate it to char '2', that mean that i want to send 2 row from .txt sd card to serial pin. Pardon me for my poor english

I haven't put it in my code yet. But maybe for example just an array like this
char code = {'2'};

Sorry if my code looks like mess, i'm new in arduino programming.

So if i read data and and translate it to char '2',

Read data from what? A pin is either HIGH or LOW. I don't see how you will translate either one to '2'.

But maybe for example just an array like this
char code = {'2'};

Not like that. An array declaration has square brackets.

You were told how to improve that.

What did you do with the info in your other thread ?