Clear line not starting with substring

Clear line not starting with substring

8

    Jan 31, 2023#1

    I need to edit a file and for every line that does not start with <RX I need to replace the line with a ^p.

    Is that possible?

    6,686585
    Grand MasterGrand Master
    6,686585

      Jan 31, 2023#2

      There are several possibilities to do that. Here are described two possibilities.

      There can be executed a Perl regular expression Replace all with the search expression ^(?!<RX).*(?:\r\n|$) and use as replace string either just \r\n to just change the lines not starting with <RX to an empty line or an empty replace string to delete all lines not starting with <RX.

      There can be run with Unix or Perl regular expression engine a Find with search expression ^<RX or with UltraEdit regular expression a Find with search expression %<RX and check the advanced option Filter lines with selection of Show to get shown just the lines starting with <RX and use next on ribbon tab Edit in first group Select and delete from popup menu of third item Delete the command Delete all hidden lines.
      Best regards from an UC/UE/UES for Windows user from Austria

      8

        Jan 31, 2023#3

        Works like a charm! Thank you.