Remove all entries from file containing a substring?
#3
(20 Mar 14, 06:04AM)Mousikos Wrote: Hey so I pull my nicknameblacklist from somewhere but they have exceptions to clans that seem to cause trouble. Is there anyway to remove them with, say, a sed command?

Grep is perfect for this scenario: grep -viE '(PATTERN1|PATTERN2|PATTERN3)' FILE > OUTPUTFILE

-v = only show entries that don't match the text
-E = regular expression, allows you to search for multiple patterns as per my example above.
-i = case insensitive
Thanks given by:


Messages In This Thread
RE: Remove all entries from file containing a substring? - by RandumKiwi - 20 Mar 14, 09:00AM