Recalculation of lines in a file on the SD card.

Even if you just run this VOID twice

The term is FUNCTION, not VOID!

How is it possible to solve this problem?

Get rid of the String usage. It pisses away resources unnecessarily. sprintf() and a char array are MUCH better alternatives.

Add some debugging statements. Are you finding that the files exist, or not? Are you finding anything in the files?

this is a fragment, but it has everything necessary

No, it doesn't.

this is my diploma work, and time is running out.

Your problem for waiting so long to get started, not ours.