Fast SD Card Data logging

It this is logging fast (many times a sec), there is no need to open/close the file during the logging.
Close when logging is done.

But if: logging is once an hour ? Then the data will be written to the card (512bytes/16bytes) every 32 hours.
You dont want a powerdown after 30 hours (all data lost)
Hope you can see the 'problem'.
If you want writing to happen enery n hours or logging point: count or use millis() to determine when to flush data to the card. (all 512 bytes in the buffer are written when a file is flushes or closed)

Export to a PC (excel?)

  1. Write a short routine that opens and reads the records and writes as comma separated values to a second file.
  2. Let Arduino read the record and write them to the serial port. A simple Terminalprogram e.g. "tera term" can recieve them an write them to a file on your PC (or copy /paste??)