I assume that you don't want to delete the whole content of the text file, but just part of it.These snippets are simplified.
file.txt contains: "Hello World, here here I am!";
FILE *fp = fopen("file.txt", "rt");
char buffer[1024];
fgets(buffer, sizeof(buffer), fp);
fclose(fp);
// now we do some editing action:
strcpy(&buffer[18], &buffer[23]);
// This would result in buffer containing "Hello World, here I am"
// This deletes any content of file.txt
fp = fopen("file.txt", "wt");
// This writes edited content back to the file
fprintf(fp, buffer);
fclose(fp);
fp = NULL;