Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: How to duplicate lines

by bichonfrise74 (Vicar)
on Mar 04, 2010 at 00:06 UTC ( #826580=note: print w/replies, xml ) Need Help??

in reply to How to duplicate lines

Something like this?
#!/usr/bin/perl use strict; while (my $line = <DATA>) { print $line; if ( $line =~ /\sip address/ ) { $line =~ s/(\d+.\d+.\d+.)252/${1}100/; print $line; } } __DATA__ ip vrf forwarding ABC:Defgh ip address ip vrf forwarding ABD: Efghi ip address

Replies are listed 'Best First'.
Re^2: How to duplicate lines
by ddrew78 (Sexton) on Mar 05, 2010 at 13:13 UTC
    Great, thank you so much. That did the trick.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://826580]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2016-10-21 22:04 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (291 votes). Check out past polls.