Community
    • Login

    How to delete multiple words/part of lines in log

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 512 Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          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 Offline
            Marko Dmitrović
            last edited by Marko Dmitrović

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

            Thanks! :)

            1 Reply Last reply Reply Quote 1

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors