Go Down

Topic: SD card Data logger - Removing and entry from log (Read 310 times) previous topic - next topic


How to remove a Particular entry from the data logs' file in the SD card.
The file type is .csv.

How to traverse the entries in the file.


Are you asking how to remove the entry using the Arduino? Why do you want to do that?

I don't understand what the purpose would be, the point of a data log is to log data, not to remove data from the log. You may want to add some logic to your sketch to be sure the data is good before logging it and then resample if needed. You could also filter outliers, etc. from the data during analysis of the log. You can always manually remove an entry from the file on your computer by opening it with a spreadsheet program or text editor.


The file type is .csv.
The name of the file, including the extension, is irrelevant.

You need to define what constitutes a record. You need to open one file, and read everything up to the record you don't want. Then, you close that file, open another file, and write everything that you want to that file, and close it.

Then, you open the first file again, position the cursor after the record you don't want, and resume reading to the end of the file. Close the file, open the second, and write everything to it. Close the second file.

Then, delete the first file, and rename the second file.

Depending on the amount of data, you may have to open and close both files many times to copy all the data.
The art of getting good answers lies in asking good questions.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131