Find lines and remove them

Find lines and remove them

1581
Power UserPower User
1581

    Jan 18, 2006#1

    Hello

    I use UE 10.10c and I want to

    a) find lines matching some keywords
    b) remove (!) them from my file

    To find something, list the lines and copy them to clipboard is not the problem.

    The question is: How to remove/delete the lines from file?

    Peter

    6,686585
    Grand MasterGrand Master
    6,686585

      Jan 19, 2006#2

      Can be done with a regular expression replace. First determine which style you use for regular expression. Look at Advanced - Configuration - Find - Unix style Regular Expressions. If this option is not enabled, you use regular expressions with UltraEdit style.

      To delete some lines with an UltraEdit style regular expression replace use following:

      Find What: %*keyword*^p
      Replace With:

      % ... start of the line
      * ... 0 or more occurrences of any character
      ^p ... line termination (CRLF = carriage return, line feed)

      Run Replace All several times until search string not found anymore.

      See help of UltraEdit for more details about regular expressions.
      Best regards from an UC/UE/UES for Windows user from Austria

      1581
      Power UserPower User
      1581

        Jan 19, 2006#3

        Mofi,

        that's a way to delete the lines immediately without controling. But I would prefer a solution like this:

        - search it
        - list it in the window to control the results (that's important)
        - remove it - if you want - or cancel it

        Peter

        6,686585
        Grand MasterGrand Master
        6,686585

          Jan 19, 2006#4

          Then do not use "Replace All" but use normal replace with "Start" button. UltraEdit sets the cursor to the first line where your keyword is found and selects the line. Now you have several options like "Find Next", "Replace", ... It's simply a step by step replace with user interaction.
          Best regards from an UC/UE/UES for Windows user from Austria