I would like to remove all lines from a textfile which contain a certain keyword.
So far I only found:
<linecontains>
<contains value="assert"/>
</linecontains>
but I don’t know how to remove those lines.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You would use that filter in a filterchain, in a task which supports the filterchain element, i.e. the built-in Concat, Copy, LoadFile, LoadProperties, Move tasks.
So, for example, copy or move the file using a filterchain containing your linecontains filter.
Use the
negateparameter on yourlinecontainsfilter to exclude lines containing that string.Example:
Before:
After:
To answer your followup question on applying to selected files in a directory: