read txt from sd and save it on string

hello
I am new in arduino
I have a question :
how can I read text from SD and put it on string .
can you help me?

how can I read text from SD and put it on string .

First, you need to initialize the hardware.

Second, you need to open the file.

Third, you need to declare an array to store data in.

Fourth, you use the read() method of the File instance to actually read a character from the file.

Fifth, you store that character in the array.

You’ve provided no evidence that you have tried ANY of these steps.

I do these step but my problem is about program
I use example program(read/write) and define my string and put the text on form sd
but when I Check the string it isnot my text it is some number
how I can do this ?

ReadWrite.ino (1.44 KB)

This is not a string (character array) nor a String but a variable of type char.

char string;

The below is not a concatenation (because string is not a String object) but a simple addition (like 5+10).

string=string+myFile.read();

I don't have experience with the SD library hence a simple solution using the String class (I would actually prefer to use a character array but too lazy to figure it out now). Simply change 'char' in the first code part above to 'String' (note the capital 'S').

String string;

Others can provide an example using character arrays; in general the String class is considered evil.

I do this but I have this problem yet

I do this but I have this problem yet

You have a problem posting your code. Until you get help, and get over that problem, you are wasting your time, and ours, here.

p990:
I do this but I have this problem yet

Show your code; if it does not compile, show your errors as well.