0

I need to obtain something like the following:

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Frank
  • 2,083
  • 8
  • 34
  • 52
  • `^.*found device.*$` with no case sensitive, works here. – eexpress May 13 '20 at 07:15
  • 1
    Closing this as a [duplicate] makes no sense since the question it links to is about Notepad++ and not Geany. Even if the answer were the same for both, there's no reason to expect that it would stay that way. – DocSalvager Nov 17 '20 at 04:03

1 Answers1

1

This is maybe not the most advanced version, but should do the trick:

Go to Search -> Replace and activate Regular Expressions. Something like this would match your search

^.*(Found device|FOUND DEVICE).*$

Replace it with an empty string.

enter image description here

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.

enter image description here

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.

frlan
  • 6,950
  • 3
  • 31
  • 72