read sd card into multiple arrays

i have 2 problems… one is deleting a line from a file. the second is reading data into multiple arrays from sd card file.

i have created a device that reads and parses data from serial. so i get data, i convert it into floating point numbers, and save number (and more but not interfering with the problems), the user can hit a delete button that will get rid of the data from the array how should i go about getting it off the sd card? (i am currently using the tinyfat library from Electronics - Henning Karlsen)

the next problem is every time the unit resets i have it add the line “reset”. is there any way to get the file name to increment? (ex. "data1.txt, data2.txt, etc.) or is there a way to get it to scan for a line “reset” and split into array1, array2 etc.

the end result is i want the unit to take the history of data points (unknown number of both history and points) and graph each ?file? in a different color. say i have 5 “historys” 4 with 50 data points 1 with 25, i want them to be in 5 different colors all on the graph.

My only SD-card experience is with the Adafruif Data Logging Shield. Their example shows how to generate a new filename:

  // create a new file
  char filename[] = "LOGGER00.CSV";
  for (uint8_t i = 0; i < 100; i++) {
    filename[6] = i/10 + '0';
    filename[7] = i%10 + '0';
    if (! SD.exists(filename)) {
      // only open a new file if it doesn't exist
      logfile =, FILE_WRITE); 
      break;  // leave the loop!

  if (! logfile) {
    error("couldnt create file");

  Serial.print("Logging to: ");

Adafruit also has a tutorial on how to graph data using a spreadsheet (like Open Office or Excel) or Gnuplot on Linux:

thanks for the help with the file names... but i am using the ITDB02-3.2 ( to display data, and i have it graphing the data... it is a graphic tft screen. how would i go about reading the data from the files into an array.