I clarify the question: I need to delete specific line from a file (I know the contents of the line and its number) but I need to do it **without overwrite the entire file. **
Any suggestions or examples would be greatly appreciated!
I clarify the question: I need to delete specific line from a file (I know the contents of the line and its number) but I need to do it **without overwrite the entire file. **
Any suggestions or examples would be greatly appreciated!
You will have to overwrite the file - it is the nature of saving the file.
You should:
The text will now be what you are looking for.
Well, you could write a copy of your file minus the line you want to have deleted, then delete the original file and rename the copy to the original's file name. Technically speaking, there's won't be anything overwritten this way, although it only makes sense if the question they asked you was a riddle.