SD card Module write content of one file to another

Hi, im new to arduino. Im trying to build a time attendance system for a summer camp with 50+ rfids, a RFID reader and an sd card module. The SD card module stores the Logfile and one file for each card with the UID as the Name of the file and inside the file you have the name of the card owner.

  1. I have trouble getting the arduino to open the file file with the same uid as name as the RFID reader reads. should look something like this. uidString is a variable that contains the UID
myFile2=SD.open("uidString.txt", FILE_WRITE);
  1. How can I open 2 txt files at once (log file and UID/Name file) and then get the content of one file and print it in the oter? Should look something like this(part of my script)
if (myFile) {
    Serial.println("File opened ok");
    myFile.print(uidString);
    myFile.print(", "); 
    if (myFile2)
      while (myFile2.available()) {
        myFile.print(myFile2.read());
      }

Why open 2?

Check to see if the file exists, if it does, then it is a valid RFID, open that file, read the contents. Store into a variable. Open log file, write your data.

This could all be done with the same SD instance.

the SD library supports only 8.3 filenames. max 8 characters of filename, a dot and then max 3 charactes of filename extension

Juraj:
the SD library supports only 8.3 filenames. max 8 characters of filename, a dot and then max 3 charactes of filename extension

Thanks for that info. So it is just like old DOS days. I suspected this, thanks for the confirm.