Hi,
SdBestand is a global variable that is continously updated by appending new text at every cycle of the loop:
while (SD.exists(SdBestand)==true) {
Nummer++;
//has to empty the char SdBestand!!!
itoa(Nummer,Cijfer,4);
strcat (SdBestand, Logging);
strcat (SdBestand, Cijfer);
strcat (SdBestand, txt);
}
simply change the first "strcat" with a "strcpy". This function copies a string (the second argument) in another (the first argument) overwriting the initial content. Another solution is to reset the string with a terminator character:
SdBestand[0] = '\0';
strcat(...);
strcat(...);