Community
    • Login

    How to delete multiple words/part of lines in log

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 286 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Marko DmitrovićM
      Marko Dmitrović
      last edited by

      Hi!

      Lots of time I’m editing huge log files, for ex. today I’m editing ~ 600 lines. How can I use regex to delete specific stuff to save time? To be precise:

      access-list xxx extended permit udp host 10.10.10.10 20.20.20.20 255.255.255.0 eq snmptrap (hitcnt=0) 0xc1bfb91f
      access-list xxx extended permit udp host 10.10.10.10 20.20.20.20 255.255.255.0 eq snmptrap (hitcnt=500) 0xc1bfb91f

      So afterwards it’s just:
      access-list xxx extended permit udp host 10.10.10.10 20.20.20.20 255.255.255.0 eq snmptrap
      access-list xxx extended permit udp host 10.10.10.10 20.20.20.20 255.255.255.0 eq snmptrap

      So basically, I just need to delete any stuff after (

      Tnx

      1 Reply Last reply Reply Quote 0
      • Sunel AbdullahS
        Sunel Abdullah
        last edited by

        You can try

        CTRL+F
        Then click on Change and search for: (.*

        It search for text that contains ( and all after the ( will removed

        Sunel AbdullahS 1 Reply Last reply Reply Quote 2
        • Sunel AbdullahS
          Sunel Abdullah @Sunel Abdullah
          last edited by

          @sunel-abdullah a93ba3c5-ff65-4781-b3ef-ff1e7ab4c8ad-image.png

          1 Reply Last reply Reply Quote 1
          • Marko DmitrovićM
            Marko Dmitrović
            last edited by Marko Dmitrović

            Done it!
            It’s going with: \ (.*

            Thanks! :)

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors