SD card write/read failure

Hi everyone

I'm using Arduino v 1.8.5, & attempting to store sensor data on an SD card using a UNO board with a duinotech datalogger shield. The shield has chipselect on pin 10 and the arduino library example 'CardInfo' works correctly, producing the following messages for two SD cards I've tried:

a. card one (an old one!)

Initializing SD card...Wiring is correct and a card is present.

Card type: SD1

Volume type is FAT12

Volume size (bytes): 31080448
Volume size (Kbytes): 30352
Volume size (Mbytes): 29

Files found on the card (name, date and size in bytes):

b. card 2: 64 GB Avoca card

Initializing SD card...Wiring is correct and a card is present.

Card type: SDHC
Could not find FAT16/FAT32 partition.
Make sure you've formatted the card

However none of the other library examples work. Even the very basic sketch (below) that I copied from the shield datasheet does not write to either card. I have zero idea how to proceed so - bearing in mind that I am a beginner at coding - any advice would be very welcome.

#include <SPI.h>
#include <SD.h>
File f;
void setup() {
SD.begin(10); //CS on pin 10;
f = SD.open("data.txt", FILE_WRITE); //open file for writing
f.println("Writing some data to the card..."); //output some data
f.close(); //then close the file
}
void loop() {
}

quantumdolt:
Make sure you've formatted the card

What it should have said is

Make sure you've formatted the card in the proper manner

Have you done that? There is a sticky about this at the head of this forum.