PaulS:
From the examples I can easily read the entire file with myFile.read()
No, you can't. read() reads one character. There are other overloads that take arguments that allow you to read more than one character. If you have fixed length records, you could read an entire record in one shot.
while (myFile.available()) {
x = (myFile.read());
}
The parentheses around myFile.read() are not needed. The result of this while loop is that the last character from the file is stored in x. That hardly seems like what you want to do.
I am a little confused by this. If I understand correctly, that portion of the code will read one character at a time starting with the first and going to the end. So it is overwriting the x value each time so it should end with the value of the last character in the file. Why do both x and y end up being equal to 42 when the only information in the x1.txt file is 420 and 210 in the y1.txt file? Shouldn't that end up with x and y equal to 0? How can I set my variables, x and y, to be equal to one entire line instead of one character?
PaulS:
From the examples I can easily read the entire file with myFile.read()
So, you plan to have 200 files? Not a good plan, if speed is any kind of issue.
I guess that was a stupid Idea but that leads me back to reading one line at a time. I imagine it can be done with a for loop instead of a while loop. Does the SD.remove("unwanted.txt") function for deleting files work in a similar way so that it only deletes one character at a time or does it simply delete the entire file at once? If it does it all at once, how can I overwrite one line or delete one line at a time when the number of entries gets to a desired level?
Thanks for the help