Updating a file in place
You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster.If you do not already have a cluster, you can create one by using Minikube, or you can use one of these Kubernetes playgrounds: Make a note of the names of the running Pods.David, You can't just update a few lines in the middle of a file.Rather, you will have to write your changes at the appropriate point in the file, and then write the information that you want to write after the changes back to the file (for the rest of the file).
To do it safely you'd have to read the file into a buffer, updating any lines as required, and then re-write the file.
If you wish to run a silent update, instead of: Anand Khanse is the Admin of The Windows Club.com, a 10-year Microsoft MVP Awardee in Windows (2006-16) & a Windows Insider MVP.
Please read the entire post & the comments first, create a System Restore Point before making any changes to your system & be careful about any 3rd-party offers while installing freeware.
Create a new temporary file and write everything to that instead. It's easier and safer (i.e., if something goes wrong, delete the temporary and the original remains intact).
I have to open a text file in c# and read few lines and then I need to update some lines in the middle of the file.
Search for updating a file in place:
However, if you are replacing arbitrary length lines, the only easy solution is to create another file and write it anew.