-4

I have the following scenario. I have a file with the following content.

start-I/p          end-I/p          code
10.35.210.1       10.35.210.255     User1
10.35.145.1       10.35.145.255     User2

I want the output in the following manner.

ip             code
10.35.210.1    user1
10.35.210.2    user1
10.35.210.3    user1
10.35.210.4    user1

and so on until

10.35.210.255  user1
10.35.145.1    user2
10.35.145.2    user2
10.35.145.3    user2
10.35.145.4    user2
so on till
10.35.145.255  user2.

Can any one help me with a suitable solution?

Paul R
  • 208,748
  • 37
  • 389
  • 560
  • 3
    Too broad - you need to make an attempt at this first and then come back if you have any specific problems. – Paul R Mar 26 '15 at 11:06
  • hi , I am trying in shell scripting to achieve this...But not able to do so... – emperror rakeesh Mar 26 '15 at 12:14
  • You should post the shell script that you've written so far, even though it's not working, and then people here can help you to fix the bugs. – Paul R Mar 26 '15 at 12:19

1 Answers1

0

You could use python its a matter of only two loops.convert IP to integer [Conversion from IP string to integer, and backward in Python, increment it and print it along with the user Thats it

Community
  • 1
  • 1
Monster
  • 71
  • 1
  • 1
  • 6