[SOLVED] Can't open .txt file on SD card


I’m using this SD card reader, this SD card (16GB - formatted to FAT32), and an Arduino Nano to read a .txt file from the SD card and print the contents to the serial monitor. My code is below.

  This example shows how to read data to and from an SD card file
  The circuit:

   SD card attached to SPI bus as follows:
 ** MOSI - pin 11
 ** MISO - pin 12
 ** CLK - pin 13
 ** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)

#include <SPI.h>
#include <SD.h>

File myFile;

void setup() {
  // Open serial communications and wait for port to open:

  Serial.print("Initializing SD card...");
  if (!SD.begin(4)) {
    Serial.println("initialization failed!");
  Serial.println("initialization done.");

  if (SD.exists("soundFile.txt")) {
    Serial.println("soundFile.txt exists.");
  } else {
    Serial.println("soundFile.txt doesn't exist.");

  // open the file
  myFile = SD.open("soundFile.txt", FILE_READ);
  if (myFile) {

    // read from the file until there's nothing else in it:
    while (myFile.available()) {
    // close the file:
  } else {
    // if the file didn't open, print an error:
    Serial.println("error opening soundFile.txt");

void loop() {
  // nothing happens after setup

Unfortunately, the code successfully initializes communication with the SD card, but for some reason, it throws an error when I try to open the text file to read:

Initializing SD card…initialization done.
soundFile.txt doesn’t exist.
error opening soundFile.txt

All electrical connections are correct (grounds, etc) and the .txt has been successfully uploaded to the SD card (verified - including name spelling). In case anyone is interested, I have attached the .txt file I want to use.

This is my first time using an SD card, am I doing something wrong??? Any help is appreciated!

soundFile.txt (293 KB)

I found the answer here. Much thanks to LarryD!!

Looks like my file name had too many characters, lel.