cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
733
Views
0
Helpful
7
Replies

Change ip address list style

Leftz
Level 4
Level 4

Hi We have several ip address like below. and hope to change ip address list style like 

10.0.0.1, 10.0.0.3, 10.0.0.9-10, 10.0.0.100, 10.0.1.1-10.0.1.3

We hope these ip address are listed like below using python. Anyone can help show its commands? Thank you

10.0.0.1,

10.0.0.3,

10.0.0.9,

10.0.0.10,

10.0.0.100,

10.0.1.1,

10.0.1.2,

10.0.1.3

 

1 Accepted Solution

Accepted Solutions

balaji.bandi
Hall of Fame
Hall of Fame

You can capture that information to input and sort as below :

image.png

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

View solution in original post

7 Replies 7

Hello,

I honestly have no idea what you are after. What is the context of your question ? What are you trying to accomplish ? Elaborate so we can understand what you are asking...

Leftz
Level 4
Level 4

@Georg Pauwen Thanks Georg for your reply. We have a lot devices which are monitored by two servers, server 1 and server2. ip address in server 1 is expressed like 10.0.0.9-10, and ip address in server2 is expressed like 10.0.0.9 and 10.0.0.10. We want to compare two group of ip address to try to know if there are duplicate ip address, so we have to use same style of ip address expression to compare. that is why we need to change 10.0.0.9-10 into 10.0.0.9, 10.0.0.10 using python. 

 

Hi We have several ip address like below. and hope to change ip address list style like 

10.0.0.1, 10.0.0.3, 10.0.0.9-10, 10.0.0.100, 10.0.1.1-10.0.1.3

We hope these ip address are listed like below using python. Anyone can help show its commands? Thank you

10.0.0.1,

10.0.0.3,

10.0.0.9,

10.0.0.10,

10.0.0.100,

10.0.1.1,

10.0.1.2,

10.0.1.3

balaji.bandi
Hall of Fame
Hall of Fame

You can capture that information to input and sort as below :

image.png

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Leftz
Level 4
Level 4

@balaji.bandi Thanks for your info. ip address is like this 10.0.0.1-3. 

can we do it like this?

IP = ['10.0.0.1-3' , '10.0.1.10']

10.0.0.1-3  (in this case you looking )

10.0.0.1 

10.0.0.2

10.0.0.3

you need to create another logic to process this.

if you looking :

10.0.0.1-3

10.0.0.10

then same should work.

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Leftz
Level 4
Level 4

Thank you balaji