Notepad++ Organize IP Address List Numerically

Issue: Require numerically organizing a long list of IP addresses using the Notepad++ application

Solution: Use Regex expressions in the “replace” feature of this application.

Step 1

Open the replace dialogue. Please be sure to switch the Search Mode to “Regular expression” (by default the search mode is “normal”).

Search for:

(?:^|(?<=\.))\d(\d)?(?=\.|$)

Replace with:

\x20(?1:\x20)$0

Step 2

Sort the list with the option:

Edit >> Line Operations >> Sort lines Lexicographically Ascending

Step 3

Remove the spaces:

Search for:

\x20

Replace with:

Nothing! Leave this field empty…

Solution source: https://notepad-plus-plus.org/community/topic/14354/can-i-sort-ip-addresses-in-numeric-value/2

Leave a comment

BlogLogistics