title: Arduino Nano SD Append data from existing File (.csv)
body: <p>I saw the function &quot;fseek&quot; to get a position into a File. But it doesn't works, i dont know why. I want to add text in the end of the file (append)and have the historical measurements from differents days.</p>
  <pre><code>    void init_SD(void) {
       // init sd
        Serial.print(&quot;Iniciando SD ...&quot;);
        if (!SD.begin(chip_select)) {
          Serial.println(&quot;No se pudo inicializar&quot;);
          return;
        }
        Serial.println(&quot;Inicializacion exitosa&quot;);
        
        if (!SD.exists(&quot;filename.csv&quot;)) // voy a escribir el archivo llamado &quot;ensayo.csv&quot;: si existe, lo escribo. Si NO existe, lo crea
        { 
          // uso de archivo--&gt; see below &quot;A&quot;
          myFile = SD.open(&quot;filename.csv&quot;, FILE_WRITE);
          if (myFile) {
            myFile.fseek(myFile.size()); 
            myFile.println(&quot;Titulo Archivo&quot;);
            myFile.println(&quot;Hora de Medicion,Tiempo [s],Corriente [A]&quot;);
            myFile.close();
          } else {
            Serial.println(&quot;Error creando el archivo&quot;);
          }
        }
      }
  </code></pre>
  <p>&quot;A&quot;: when i use this, the text doesnt appear in the .csv. Should i use &quot;file.fread&quot; before use fseek?</p>
  <p>I used SD.open(&quot;filename.csv&quot;, O_APPEND) and  SD.open(&quot;filename.csv&quot;, O_WRITE) but the same problem.</p>
  <p>Hw: Arduino nano + shield &quot;datalogger&quot; with RTC and SD card.
  Sw: Arduino IDE with (SD.h, SPI.h).</p>
  <p>Thanks!</p>