Problem with SD Card Initialization

I have arduino uno and sd card module.
I need to measure the voltage by A0 and A1 and save data with the time on SD module card.
The main porblem - I still get information that initialization is failed.
I added digitalWrite(pinCS, HIGH); line but it still doesn't work.



#include <SD.h>
#include <SPI.h>
File myFile;
int pinCS = 10;
int readValue1 = 0; //Odczytana wartość z ADC
float voltage1 = 0; //Wartość przeliczona na napięcie w V
int readValue2 = 0; //Odczytana wartość z ADC
float voltage = 0; //Wartość przeliczona na napięcie w V



void setup() {
  Serial.begin(9600);
  pinMode(pinCS, OUTPUT);
  digitalWrite(pinCS, HIGH); // Add this line


//  SD Card Initialization
 if (SD.begin(pinCS))
 {
  Serial.println("SD card is ready to use.");
} else
  {
 Serial.println("SD card initialization failed");
 return;
}

 // Create/Open file
  myFile = SD.open("test.txt", FILE_WRITE);

// if the file opened okay, write to it:
  if (myFile) {
   Serial.println("Writing to file...");
  // Write to file
myFile.println("Testing text 1, 2 ,3...");
 myFile.close(); // close the file
 Serial.println("Done.");
 }
// if the file didn't open, print an error:
else {
 Serial.println("error opening test.txt");
}
 // Reading the file
myFile = SD.open("test.txt");
  if (myFile) {
  Serial.println("Read:");
 // Reading the whole file
while (myFile.available()) {
  Serial.write(myFile.read());
 }
  myFile.close();
 }
else {
  Serial.println("error opening test.txt");
 }

}
void loop() {

  // put your main code here, to run repeatedly:
readValue1 = analogRead(A0); //Odczytujemy wartość napięcia
voltage1 = readValue1 * (5.0 / 1024.0); //Przeliczenie wartości na napięcie
  Serial.println(voltage1); //Wysyłamy zmierzone napięcie
  delay(2000); //Czekamy, aby wygodniej odczytywać wyniki


readValue2=analogRead(A1); //Odczytujemy wartość napięcia
voltage2=readValue2 * (5.0/1024.0); //Przeliczenie wartości na napięcie
 Serial.println(voltage2); //Wysyłamy zmierzone napięcie
 delay(200); //Czekamy, aby wygodniej odczytywać wyniki

}

Exactly how is the SD card module connected to the Uno ?
Which pins do you have it connected to ?

run the CardInfo example

Ok.. I mistook pin13 for GND...
now I haven't got an error with initialization but I get empty file saved on SD card.
What should I correct in my code? And what should I do to not overwrite the file after next start? I want to get second file (e.g. test01, test02) or open the test.txt and add measurements there?

SD.remove("test.txt");
https://www.arduino.cc/en/Reference/SDremove

It will remove the file. I still need the previous data saved on SD card.

Copy the data somewhere else and start over.

Then append the new data to it, perhaps with a timestamp

sorry. if don't delete the file it will append