FileName="1.pdf",filepath="f:/test1"
FileName="2.pdf",filepath="f:/test2"
FileName="3.pdf",filepath="f:/test3"
FileName="4.pdf",filepath="f:/test4"
FileName="5.pdf",filepath="f:/test5"
FileName="6.pdf",filepath="f:/test6"
I don’t want to create a new file. Overwriting in a same file is ok
I tried the following.
var reader = File.OpenText("f:/test5");
reader. // ?
I don’t know what to put after reader. If any alternate way is there, provide me a solution.I want to remove only a particular line based on the unique file name. If I am having 5.pdf as the filename, then I need to delete or remove the entire line which is “FileName=”5.pdf”…line from the file. I don’t want to overwrite the contents in a new file again. Provide me a solution. Thanks.
You cannot reomve a line from a textfile without rewriting the file. Do something like this
EDIT:
You can find a line with a specific filename like this: