Delete lines which contain string in a file

Rudi Goldman rgoldman23 at gmail.com
Wed Feb 18 16:42:05 EST 2009


Hi,
Go easy on me as I am a new to Python and am trying to solve a practical
problem that is driving me bananas.
Basically I have 2 text files, a source and a target. I want to be able to
delete all of the lines in the target file which contain text from any line
in the source file.
i.e.
Source:                                     Target:
111                                           xxx 111 yyy
222                                           xxx  333 sss
333                                           jjj   444 sss

After executing this code the target file should only consist of the line:
  jjj   444 sss
Any help on this one would be greatly appreciated.

Thanks,
Rudi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090218/04cda2c5/attachment.html>


More information about the Python-list mailing list