when you want to delete line from file or even edit it or add a line
to do that i found algorithm or in fact two algorithms.
first: when you want to delete or edit a line in a file called file.text(for example) you can copy all the contents of this file into another file called demo.text(for example) and when you reach the line number which you to delete it or to edit you can do that.
the second algorithm is:
to edit a line in a file called file.text you can copy all the contents of this file into temporary file and making the change after that remove file.text file then create a new file called file.txt after that copy the contents of temporary into another file called file.text
and of course the temporary file automatically will be delete it.
is there another algorithm to did it ?