1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

sorting IP-Addresses

Discussion in 'T&T - Miscellaneous' started by Frank, Feb 28, 2013.

  1. Frank

    Joined:
    Aug 2, 2011
    Messages:
    258
    Likes Received:
    4
    I found an advice to easily sort IP-Addresses:
    Code:
    F:\Temp >type clip:
    192.168.85.26
    192.168.81.52
    192.168.82.70
    192.168.81.160
    192.168.85.72
    192.168.87.70
    192.168.87.111
    192.168.87.88
    192.168.170.5
    192.168.82.115
    192.168.81.173
    192.168.83.87
    192.168.87.34
    192.168.87.73
    192.168.87.107
    192.168.98.55
    192.168.87.115
    192.168.85.6
    192.168.87.117
    192.168.87.109
    192.168.87.69
    192.168.87.67
    192.168.87.48
    192.168.82.1
    
    F:\Temp >type clip: | gnusort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4
    192.168.81.52
    192.168.81.160
    192.168.81.173
    192.168.82.1
    192.168.82.70
    192.168.82.115
    192.168.83.87
    192.168.85.6
    192.168.85.26
    192.168.85.72
    192.168.87.34
    192.168.87.48
    192.168.87.67
    192.168.87.69
    192.168.87.70
    192.168.87.73
    192.168.87.88
    192.168.87.107
    192.168.87.109
    192.168.87.111
    192.168.87.115
    192.168.87.117
    192.168.98.55
    192.168.170.5
    
    HTH.
     

Share This Page