I have got the following requirement:
In a file that has many lines, i need to search for a particular line that has the word DTP. The line may be like this in the file:
src 172.23.1.23 dst 188.8.131.52 DTP 0 - 65000
If the line with the word "DTP" is found, then that line has to be removed from the file.
How to do this?
Also in some cases I need to replace that word with another word and then write that line back to the file.
I have looked at some of the file programs that use readlines, read etc, but haven't found anything that solves my issues.
any help would be very much valuable for me.