Hi,
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 192.14.2.34 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?
any help would be very much valuable for me.

Regards,
Prashanth

Go through the input file line by line writing to an output file - using either regular expression or a simple if 'dtp' in line: expression, which when true skips writing the line to the output file.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.