SdFat, insert text before another text

Hello, I'm using SdFat library and have following problem, that I can not solve. I need insert text before another text. For example, I have in test.txt string "world" and I need before that insert string "Hello". All my attempts end of overwriting the string "world". Thank you.

If you want to inset data in the middle of a file you typically have to copy the first part of the source file to a new file, write the part to be added, then copy he remainder of the source file. Then you can delete the source file and re-name the new file to have the name of the source file.

Thank you for the answer. And if I wanted to add text at begening of the file, is there any easier way?

Write the new data to a new file. Read the data from the old file and write it to the new file.

Ok, thank you.