我需要获得以下内容:
may 09 00:11:53 USER audit[1225]: Found device /dasd/cxvxc/...
may 09 00:11:53 USER audit[1226]: more text here
may 09 00:11:53 USER audit[1225]: Found device /mnt/cxvxc/...
may 09 00:11:53 USER audit[1225]: FOUND DEVICE /mnt/cxvxc/...
and remove all the rows where it finds the occurrence of found device
(case insensitive).
I tried with \Found\ device
but it is not case insensitive and how do I remove the entire line after finding?
谢谢
这可能不是最高级的版本,但应该做到这一点:
转到搜索->替换并激活正则表达式。这样的事情将与您的搜索相匹配
将其替换为空字符串。
This might leaves empty lines, which you can clean with another round of search and replace by deactivating Regular expressions again and using
\n
for the search-string.However, I would recommend you to check more specialized tools like sed or awk --- This answer Delete lines in a text file that contain a specific string looks helpful -- and via Geany's "Send selection to"-feature it can be even integrated into Geany quiet easy.