Currently working on a time of day project.
I have a file on my Arduino's SD card called mail.txt. There is a push button hooked up to the arduino with an Ethernet shield.
Action that occurs. You push the button. Arduino looks at the RTC. And writes a new line to mail.txt the time and date the button was pushed. Very simple. That part works.
When you go to the webpage hosted by the Arduino. You will see the data log from the mail.txt.....
2013-01-12 MON 15:23
2013-01-13 TUE 14:26
2013-01-14 WED 11:13
2013-01-15 THU 16:12
2015-02-05 THU 17:48
2015-02-05 THU 17:55
2015-02-05 THU 17:58
2015-02-05 THU 18:03
My question to the forum, how can I have this show up in reverse order (Recent on top)? Either Write the new button push to the top line and push everything else down, OR have the arduino read the mail.txt file from bottom line to the top line.
I have dug through tons of code, and search results, all about myFile.write and myFile.read. But nothing about the direction to read it from. Is there a way to perhaps count the amount of Line breaks in the mail.txt file. Then Go back and read read the mail.txt file and grab the last one. Then repeat it again, with a -1 and write out the second to last one?