The below command will find all occurances of a string and delete the contents of the files where this string is found.
find / -maxdepth 1 -xdev -type f -exec grep -i "stringtofind" -l {} \; -exec sed -i '/./d' {} \;
I have tried modifying it to just delete the lines where the string is found but can't get it to work.
E.g test file:
blah blah blah
blah blah blah teststring
teststringblah blah blah
blah blah blah
It would delete lines 2 and 3 and leave the file as without gaps between lines:
blah blah blah
blah blah blah