Creating a text file of a list of words that will be inputted by reading file; using readStringUntil(‘\n’).
I can read a single line and store the first word. How can the process be repeated for all lines.
How to save words as the file is read; to be used latter to compare word created in project?
Code snippet updated with routine the reads filenames until end of file. How tdo you read, for example the third word of the file?
i find very strange to use word to store (ascii) text reading …
but i work mainly with Microchip PIC … and don’t know all on arduino possibilities.
it is not a good way to do init , inside a loop for
make you init at the beginning of function or as global in your program
// Open a "Texte.txt" for reading
File word = LittleFS.open("Texte.txt", "r"); //input ascii
Serial.println("file 'Texte.txt' open failed or No 'Texte.txt' file");
for(x=0 ; x < 10; x++) //Build an arrary of words
inputTexte[x] = Texte.readStringUntil('\n');
Thank you paulfjujo.
Have list of word read from wordfile.txt. Question now is how do I print third word in the list?
Appreciate your input!
did you get all values ?
what is the result of printout ?
can you post or show us your wordfile.txt
are each word delimited by LF in your file ?
usualy separator is ‘,’ or ‘;’ as in CSV file ..
Question now is how do I print third word in the list?
String table begin at index 0 , so third value is at index 2 ..