Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file formating

Status
Not open for further replies.

sumncguy

IS-IT--Management
May 22, 2006
118
US
I have the following file


interface Loopback0
ip address 10.207.255.224 255.255.255.255
interface FastEthernet0/0
ip address 10.205.215.129 255.255.255.128 secondary
ip address 10.207.224.3 255.255.255.128
interface Serial0/0
no ip address
interface FastEthernet0/1
ip address 10.207.240.3 255.255.255.192
interface Serial0/1
ip address 10.220.6.125 255.255.255.252


I am trying to change it to
interface Loopback0 ip address 10.207.255.224 255.255.255.255
interface FastEthernet0/0 ip address 10.205.215.129 255.255.255.128 secondary ip address 10.207.224.3 255.255.255.128
interface Serial0/0 no ip address
interface FastEthernet0/1 ip address 10.207.240.3 255.255.255.192
interface Serial0/1 ip address 10.220.6.125 255.255.255.252

That is to have interface name space ip1 space ip2 etc etc
 
What have you tried so far?

How about reading the file, word by word, and whenever the word is 'interface' output a 'new-line' character before the word, otherwise just output the word, followed by a space.

Just a thought.

I hope that helps, to get you started.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top