• Login
Community
  • Login

Search and filter IP address results

Scheduled Pinned Locked Moved General Discussion
9 Posts 4 Posters 2.8k 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.
  • S
    Sarah Duong
    last edited by Mar 30, 2020, 12:16 AM

    I have the following set of lines:

    3.0.0.0-4.2.144.255-50331648-67277055-US-United States
    4.2.145.64-4.2.170.63-67277120-67283519-US-United States
    4.2.170.128-4.17.135.31-67283584-68257567-US-United States
    4.17.135.64-4.17.142.255-68257600-68259583-US-United States
    4.17.143.16-4.18.32.71-68259600-68296775-US-United States
    4.18.32.80-4.18.40.135-68296784-68298887-US-United States
    4.18.40.144-4.18.65.255-68298896-68305407-US-United States
    4.18.68.0-4.18.100.31-68305920-68314143-US-United States
    ...
    

    How to get results:

    3.0.0.0-4.2.144.255
    4.2.145.64-4.2.170.63
    4.2.170.128-4.17.135.31
    4.17.135.64-4.17.142.255
    4.17.143.16-4.18.32.71
    4.18.32.80-4.18.40.135
    4.18.40.144-4.18.65.255
    4.18.68.0-4.18.100.31
    ...
    

    I tried using search and markup IPs. This has selected exactly what I need. However I do not know how to copy or cut the highlighted characters. Does this seem to help me?

    A 1 Reply Last reply Mar 30, 2020, 12:30 AM Reply Quote 0
    • A
      Alan Kilborn @Sarah Duong
      last edited by Alan Kilborn Mar 30, 2020, 12:30 AM Mar 30, 2020, 12:30 AM

      @Sarah-Duong

      So I’ll give you another (perhaps the last) freebie, but you’ve been here before with some search-and-replace questions, and you should be demonstrating some learning by now. You should show what you’ve already tried and maybe some thoughts on what went wrong with it. Otherwise it seems that you are just sponging off of the help here whenever you need to do a replacement, and not even attempting anything yourself.

      Maybe try:

      Find what box: (?-s)-\d{4,}.+
      Replace with box: Make sure this box is EMPTY !
      Search mode radiobutton: Regular expression

      S A 2 Replies Last reply Mar 30, 2020, 12:36 AM Reply Quote 3
      • S
        Sarah Duong @Alan Kilborn
        last edited by Mar 30, 2020, 12:36 AM

        @Alan-Kilborn Thanks. This helped me.

        1 Reply Last reply Reply Quote 0
        • A
          astrosofista @Alan Kilborn
          last edited by Mar 30, 2020, 4:05 PM

          @Alan-Kilborn

          It’s too late for OP and your solution worked fine, but just for the sake of variety and taking into account that the sample data she provided are quite regular, a non-regex solution is feasible and easy to deliver (it only requires the BetterMultiSelection plugin installed and enabled):

          Giphy

          Have Fun!

          A F 2 Replies Last reply Mar 30, 2020, 5:13 PM Reply Quote 3
          • A
            Alan Kilborn @astrosofista
            last edited by Mar 30, 2020, 5:13 PM

            @astrosofista

            Yea, these days I guess Better Multiselection is the new hot thing! :-)

            1 Reply Last reply Reply Quote 3
            • F
              Fake Trum @astrosofista
              last edited by Apr 27, 2020, 10:15 PM

              @astrosofista Why not provide a guide to help others. For example, after searching for instructions, I only found one answer here, but it did not support me at all. Is it too selfish?

              A 1 Reply Last reply Apr 28, 2020, 4:14 AM Reply Quote 0
              • A
                astrosofista @Fake Trum
                last edited by Apr 28, 2020, 4:14 AM

                @Fake-Trum said in Search and filter IP address results:

                Why not provide a guide to help others.

                Hi @Fake-Trum and All

                Sure. Actually it’s a quite easy method. First off, open Preferences -> Edition, and enable the Multi-Editing Settings. It also requires the BetterMultiSelection plugin activated, which you can download and install via Plugins Admin.

                Then, do as the movie shows:

                1. Put the caret at the very beginning of the word list, that is, at the left of the number 3 (on the first line).

                2. Press Shift + Alt and move the caret from the top line until the bottom of the list with the arrow down - you will get a giant caret blinking along 8 lines with no characters selected.

                3. Press End. Eight carets will be blinking at the end of each line.

                4. Press Shift + Control + Arrow Left to backward select the words to delete or Shift + Arrow Left to move character by character.

                5. Once all the unwanted text is selected — nine steps as the .gif shows —, press Delete.

                A similar outcome, not shown in the movie, can be obtained moving forward, from left to right:

                3b) Instead of pressing End, just move to the right by words by means of Control + Arrow Right until the dash that follows the 255 number on the first line.

                4b) Press Shift + End to select the text to delete and remove it.

                That’s all. Lots of useful things can be done with the multi-selection and BMS plugin combo, for example, align columns, padding, right aligning columns, and curiously enough flip columns, that is, reverse their order.

                Have fun!

                A 1 Reply Last reply Apr 28, 2020, 12:25 PM Reply Quote 4
                • A
                  Alan Kilborn @astrosofista
                  last edited by Apr 28, 2020, 12:25 PM

                  @astrosofista

                  Nice writeup.

                  One minor quibble:

                  Preferences -> Edition

                  should be

                  Preferences -> Editing

                  Lots of useful things can be done with the multi-selection and BMS plugin combo, for example, align columns, padding, right aligning columns, and curiously enough flip columns, that is, reverse their order.

                  Well, now you’re going to have to give instructions for ALL of those operations. :-)

                  A 1 Reply Last reply Apr 28, 2020, 9:44 PM Reply Quote 4
                  • A
                    astrosofista @Alan Kilborn
                    last edited by Apr 28, 2020, 9:44 PM

                    @Alan-Kilborn said in Search and filter IP address results:

                    Preferences -> Editing

                    Good catch, thank you.

                    Concerning the further instructions plea, I know you were kidding, but that’s what I get for not knowing how to shut up my big mouth in time, ha ha.

                    We’ll see, if there’s interest, it’s a simple thing to accomplish.

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