Can be done with grep in the shell, of course, but I do it quite a lot, and find it a little quicker to experiment with the help of the simple options of a Keyboard Maestro action. ( Saves me checking man grep for simple things at the command line, and lets me keep to the familiar Javascript dialect of Regular Expressions :- )
Sorry post in an old thread, but would it be possible to have the PATTERN be dynamic? it is currently hardcoded. Ideally I'd like to be the result of a Prompt Action
Hello, thank you for your reply. It does not work with the %Variable%pattern%, but neither does it work with regular text. Given the macro is 7 years old it might not be compatible with the latest KM
EDIT: I haven't added anything new here, but I thought I should post here anyway to help other users who are looking for a macro that removes (keeps/maintains) lines that meet certain conditions. Kind of SEO :).