Remove all entries from file containing a substring?
#1
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?
Thanks given by:
#2
There is surely a way depending on what you are hoping to achieve...
http://www.grymoire.com/Unix/Sed.html
But maybe there is something I can help you with more directly, Mousikos?
Thanks given by:
#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:
#4
(20 Mar 14, 08:04AM)+f0r3v3r+ Wrote: There is surely a way depending on what you are hoping to achieve...
http://www.grymoire.com/Unix/Sed.html
But maybe there is something I can help you with more directly, Mousikos?

Nah, I have stricter connect rules than you do --- I don't allow clans that allow double clans.
Thanks given by: