Write to first line of file

myFile = SD.open("test.txt", FILE_WRITE); instead of FILE_APPEND